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: Ian Lance Taylor <iant at google dot com>
- To: Raphael Zulliger <zulli73 at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Sun, 21 Apr 2013 12:42:13 -0700
- 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>
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