This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Initialized variables location question
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: geneSmith <gene dot smith at sea dot siemens dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sun, 09 May 2004 10:16:09 +0100
- Subject: Re: Initialized variables location question
- References: <c7gtf7$rb8$1@sea.gmane.org>
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