gold linker: Access section start & end address w/o using a linker script
Raphael Zulliger
zulli73@gmail.com
Mon Apr 22 11:39:00 GMT 2013
Thanks.
Is there a chance to enhance gold to better support such use cases? Or is that out-of focus for gold? I'm not familiar with linking internals, but I think that providing additional start/end address symbols for section names starting with a '.' wouldn't be that tricky to be added, right?
On Apr 21, 2013, at 9:42 PM, Ian Lance Taylor <iant@google.com> wrote:
> 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