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: Does ld need to search for DT_NEEDED objects?


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 â


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