This is the mail archive of the binutils@sourceware.org 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: 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


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