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


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


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