This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Does ld need to search for DT_NEEDED objects?
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 20 Nov 2006 23:59:34 -0800
- Subject: Re: Does ld need to search for DT_NEEDED objects?
- References: <m3irhqkkd2.fsf@dhcp-172-18-118-195.corp.google.com>
Ian Lance Taylor wrote:
And the
algorithm in ld does not match the one used by ld.so anyhow, as it
ignores ${ORIGIN} and the use of hardware capabilities.
The DSTs need to be supported, the hardware capabilities not. If this
would make a different the DSOs are wrong.
Without looking for the dependencies, how can you adequately implement
-z defs? Yes, ideally all DSOs with symbols which are referenced should
be listed on the command line. Fact is that this isn't the case. This
is the reason why back when we added DT_NEEDED tracing support.
Removing it now is problematic. You would potentially break linking
programs which today work. This is with -z defs. But the worse part
are the silent errors you create. If you drop the DT_NEEDED tracing
program might not get the version information. Just try this: have code
which uses thread functions and is linked only against librt (not
libpthread). This currently works, the reference (e.g, to
pthread_create) is annotated with the version information. If DT_NEEDED
is not followed (librt has libpthread as a dependency) then you get an
unversioned reference. Very bad.
So, leave it in and fix it up.
--
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â