LD Changes To Implicit DSO Linking Update

Roland McGrath roland at redhat.com
Thu Feb 11 19:58:49 UTC 2010


> 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.


Thanks,
Roland


More information about the devel mailing list