gold linker: Access section start & end address w/o using a linker script

Ian Lance Taylor iant@google.com
Sun Apr 21 19:42:00 GMT 2013


On Sun, Apr 21, 2013 at 12:27 PM, Raphael Zulliger <zulli73@gmail.com> wrote:
> Thanks Ian!
> __start_SECNAME / __stop_SECNAME: I've been googling for something like this almost for hours…
>
> That certainly answers my question for "project specific" section names. But I cant see yet how it solve my question for pre-defined sections like .sbss, .sdata, etc.? Is there another trick I don't know yet? E.g. can I create section-aliasses or something like that? (again, a short google session didn't give useful results)

Yes, for those sections you do need to use a linker script, or to
arrange for some file defining the appropriate symbols to be at the
start and end of your link.

For specialized purposes like this you do need to use a linker script
with gold.  gold is optimized to not use a linker script for the
ordinary case of a hosted system.  It's OK to use a linker script for
an embedded system.

Ian



More information about the Binutils mailing list