Initialized variables location question

geneSmith gene.smith@sea.siemens.com
Wed May 12 20:29:00 GMT 2004


Richard Sandiford wrote, On 5/9/2004 5:16 AM:

> geneSmith <gene.smith@sea.siemens.com> writes:
> 
>>My question would be is how would you cause .mdata to always be located
>>right after the point where .data is loaded rather than at a fixed
>>address? In otherwords, the above SECTIONS defines things like this:
> 
> 
> Probably the easiest way is with memory regions.  The script might
> look something like this (not checked for syntax, etc):
> 
> MEMORY
>   {
>     REGION1 (r) : ORIGIN = 0x1000, LENGTH = 0x....
>   }
> 
> SECTIONS
>   {
>     .text : { *(.text) _etext = . ; } > REGION1
>     .mdata : { ... } > REGION1
>     .bss : { ... } > REGION1
>   }
> 
> See the MEMORY section of the ld manual for more details.
> 
> Richard
> 

Thanks for the suggestion. However, it didn't seem to help. I ended up 
just using the original order ok by working around the problem. However, 
it turned out I need "position independent" code to do a completely 
general solution. So I am now looking at things regarding -fpic gcc flag 
on crossgcc list.
-gene

-- 
Lit up like Levy's



More information about the Binutils mailing list