LD Changes To Implicit DSO Linking Update

Adam Jackson ajax at redhat.com
Thu Feb 11 20:21:57 UTC 2010

On Thu, 2010-02-11 at 11:58 -0800, Roland McGrath wrote:
> > Note that _libraries_ generally do not have a problem building in a
> > --no-add-needed world.  ELF does not require that all references in a
> > DSO be resolvable at ld time, and this linking change does not change
> > that.  If your library libfoo uses symbols from libbar but does not
> > itself link against libbar, that's still legal (although probably
> > impolite).
> It is ill-advised.  It's recommended to use -shared -Wl,-z,defs so that you
> will get a link-time failure for being sloppy in this way.  (You can't do
> this if the DSO intentionally has free undefined symbols as part of its
> ABI, but that is not a style we would recommend for any new libraries.)
> The reason this really matters is that you want to get symbol version
> bindings for the references from your DSO to another DSO.  It's also the
> most reliable way (the implicit way) to make sure you have rpm dependencies
> for the libraries you require.

I meant "legal" in the sense of "it'll work", not "you should do it",
but yes.

I would care a lot more about the symbol versioning thing if symbol
versions were something you could do without asm statements or linker
scripts.  Something like __attribute__((version_id)) would be perfect;
shame it only works on HPUX on ia64.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20100211/2354251e/attachment.bin 

More information about the devel mailing list