Hi Bob, I do the following:
in my linker script, I have something like
.text :
{
*(.swversection)
// no need to manually advance `.'
// other input sections follow
} > text
Then in the code:
__attribute__ ((section(".swversection"))) const char swVer[] = ...;
I hope this helps
- Wayne
On 29/01/2013 8:11 AM, Robert Henig wrote:
> I am trying to force a string into a fixed location using a linker script.
> The script contains:
>
> .text :
> {
> swVer = .;
> . += 8;
> }
>
> The code contains:
>
> const char swVer[] = "01.0904\0";
>
> After compiling the .map file shows that eight bytes are reserved at 0xc000
> and a symbol named swVer at that location. As expected .init0 is at 0xc008.
> However the linker does not initialize the memory with the version string. It
> is initialized to zeros. Anyone have any idea how to make this work?
>
> Thanks,
> Bob.
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users