This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold linker: Access section start & end address w/o using a linker script
- From: Raphael Zulliger <zulli73 at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 22 Apr 2013 13:39:05 +0200
- Subject: Re: gold linker: Access section start & end address w/o using a linker script
- References: <10A84606-654D-4FBC-A66D-40BA39916061 at gmail dot com> <CAKOQZ8ym43X48NJQbM81AiB+f-THT-we-Md0OJ1u-s-MnEpn6w at mail dot gmail dot com> <E0B8D401-6A5B-4149-9ED6-08968E4E0878 at gmail dot com> <CAKOQZ8xJHQcM4VA4ggWPB_XAL8-fJ7sARtnE2Wx=R3uK=xY=Pg at mail dot gmail dot com>
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