This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Initialized variables location question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]