Re: binutils-2.22: ld and --copy-dt-needed-entries

From: Andriy Gapon <avg_at_FreeBSD.org>
Date: Tue, 06 Dec 2011 23:41:34 +0200
on 06/12/2011 23:24 Martin Matuska said the following:
> On 6.12.2011 17:48, Andriy Gapon wrote:
>> Just for your information.
>> It seems that ld from binutils-2.22 by default has --no-copy-dt-needed-entries
>> behavior, and so explicit --copy-dt-needed-entries is now needed where the
>> previous default behavior is relied upon.
>>
>> A short excerpt from the man page for your convenience:
>>
>>> This option also has an effect on the resolution of symbols in
>>> dynamic libraries.  With --copy-dt-needed-entries dynamic libraries
>>> mentioned on the command line will be recursively searched,
>>> following their DT_NEEDED tags to other libraries, in order to
>>> resolve symbols required by the output binary.  With the default
>>> setting however the searching of dynamic libraries that follow it
>>> will stop with the dynamic library itself.  No DT_NEEDED links will
>>> be traversed to resolve symbols.
> What do we do with this?
> We can go back, patch to behave as before or to continue.
> Are there any serious complaints?

I am not sure.  Eventually all upstreams of our ports will have to deal with
this.  So far I've encountered only one problematic port (gegl) that links a
binary with -lglib-2.0 expecting that a required -liconv dependency would be
automatically picked up via DT_NEEDED.  libglib-2.0.so indeed has a DT_NEEDED
entry for libiconv.so.  But this dependency is not explicitly advertised via
pkg-config metadata:
$ fgrep -i Libs /usr/local/libdata/pkgconfig/glib-2.0.pc
Libs: -L${libdir} -lglib-2.0
Libs.private: -liconv

So there could be other issues related to this in the future.
Perhaps this is actually an issue with glib, maybe it should have -liconv in
Libs.  I am not really knowledgeable about his stuff.

-- 
Andriy Gapon
Received on Tue Dec 06 2011 - 20:41:38 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:21 UTC