This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [osol-discuss] Re: GNU ld -shared fails to link filtered symbols on Solaris
Alan Modra writes:
> > The question, I think, is why the ABS state of the symbol *definition* is
> > inherited by the symbol state of the *reference*. A reference is
> > typically undefined (UNDEF).
>
> Perhaps because the Sys V ABI says:
>
> SHN_ABS
> The symbol has an absolute value that will not change because of
> relocation.
>
> >From that wording, I don't think it unreasonable that an ABS symbol
> in a shared lib should serve as directly defining the value of a
> reference outside that lib. (I don't think it's a particularly good
> or useful way to treat ABS symbols in shared libs, but maybe I just
> haven't thought enough.)
It says "will not change because of relocation." It doesn't say "will
not ever change for any reason."
What happens if someone recompiles that shared library with a
different value?
Effectively what GNU has (re-)created here is the concept of a static
library, but just for these particular symbols. Regardless of how
they managed to do that, or what internal problems they have in
unwinding the damage, this looks like a pretty clear-cut bug to me.
--
James Carlson, KISS Network <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677