This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerpC pointer_equality_needed optimisation


On Mon, Feb 25, 2008 at 03:39:40PM -0800, H.J. Lu wrote:
> I am not sure if it should work. deflib.so and nodeflib.so have
> different ABIs. This behavior isn't well defined.

Yes, the ELF gABI is sadly lacking in defining the behaviour of weak
symbols.

I think that a good guiding principle is that shared libraries should
behave as closely as possible to archives.  Therefore, it would be
good if, as much as possible, weak references to definitions in a
shared library behaved the same as weak references to definitions in a
static library.

With shared libraries you always have the possibility of updating the
library, then running your executable using the new library version.
Conceptually this is like relinking the executable object files
against a new static library.  Of course if you relink with a new
static library, weak references may change.  They will resolve to zero
(if the archive doesn't define the symbol in question), or to a symbol
in the library (if the archive does define the symbol), regardless of
how they resolved using an old static library.  We don't currently
support this for shared libraries due to not emitting the necessary
dynamic relocations.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]