This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: linker script question
- To: npapadon at yahoo dot com
- Subject: Re: linker script question
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: Wed, 28 Mar 2001 01:27:56 -0800
- CC: binutils at sourceware dot cygnus dot com
- References: <m34rweuyiz.fsf@h0050bad6338d.ne.mediaone.net>
- Reply-to: Geoff Keating <geoffk at redhat dot com>
> From: Nick Papadonis <npapadon@yahoo.com>
> Date: 28 Mar 2001 02:45:56 -0500
> Hi. Quick question that might help me resolve a possible bug in
> binutils.
>
> In the following linker script snippit:
>
> .data :
> {
> _sdata = . ;
> *(.data)
> } > ram
>
>
> Can I assume, _sdata becomes a symbol and is initialized with an
> unsigned integer value of the memory location at .data?
Yes. That is, the value of the symbol should be equal to the start of
the ".data" section.
> Should _sdata be a symbol located at .data and assigned nothing?
It should be equal to ".data+0". All symbols have some value. It
should not be '*ABS*+0', which is the location zero, unless the linker
knows this in some other way.
> 'ld' is apparently doing the later. I don't think this is correct.
I'm pretty sure this works. Many linker scripts use this construction.
--
- Geoffrey Keating <geoffk@geoffk.org>