This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: IA64 symbol addresses always 0?
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ian Wienand <ianw at gelato dot unsw dot edu dot au>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 3 Jan 2004 22:49:02 +1030
- Subject: Re: IA64 symbol addresses always 0?
- References: <20031222062620.GC31201@cse.unsw.EDU.AU>
On Mon, Dec 22, 2003 at 05:26:20PM +1100, Ian Wienand wrote:
[snip]
> Shouldn't the symbol value be the PLT entry for the relocation?
>
> This meshes with what I understand of 386 behaviour, where an
> R_I386_JUMP_SLOT gives it's value as the PLT entry if I haven't
> misunderstood:
x86 is really the odd one out, as undefined symbols are normally zero.
x86 gives undefined function symbols a value in the plt so that you can
load the "address" of the function in an app without needing text
relocations. The dynamic linker co-operates with another hack that
ensures a shared lib defining the function also gets the same address.
This is needed to make function pointer comparisons work between an app
and a shared lib. ia64 uses a different scheme for function pointers
that doesn't need this hack.
Note that CVS x86 ld *doesn't* set all undefined function symbols to
their plt entries, only those that have their address taken in the app.
--
Alan Modra
IBM OzLabs - Linux Technology Centre