This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Section at absolute address
- From: Ramana <ramana dot venkat83 at gmail dot com>
- To: binutils at sourceware dot org
- Cc: my dot 1337 dot trash dot mail at googlemail dot com
- Date: Tue, 3 Aug 2010 09:50:05 +0530
- Subject: Re: Section at absolute address
> using ld, how can I locate a section at an absolute address?
> I want to do another linking step (using relocatable binary) and want a
> given section to stay at that very address it had after the first link
> took place.
> Whenever I define a symbol in a linker script like "foo=1;" nm tells me
> that this symbol is absolute and thus is not changed in further linking
> steps. Basically that is what I want for a section (or all symbols in
> that section).
Assuming that you want the section/symbols to reside at the defined
address (my_address) after the first linking step you can do the
following in the linker script
for symbol:
foo = ABSOLUTE(my_address);
for section:
SECTIONS{
my_sec my_address: AT(my_address) { }
}
If you want to have the section/symbols to reside at the defined
address in final image too then follow the above steps in each linker
script you use in every linking step.
Ram
Freescale Semiconductor, India