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: library dependencies and --as-needed


On Thu, Jan 29, 2009 at 03:26:19PM +0000, Brian Gough wrote:
> It seems like it would work if the search with --as-needed was
> recursive, is there any conceptual reason for it not to do that?

It just happened that way because that's what we do for libs brought
in only because they are mentioned as dependencies of other libs that
ld is linking against.  ie. if we have

       app
        /\
       /  \
     libx liby
           \
            \
            libz

and we link app just against libx and liby, you won't get a DT_NEEDED
tag in app for libz unless app references some symbol in libz
directly.  The idea is that if app does reference libz, then we want
to protect against some newer liby being installed that no longer
needs libz.

--as-needed is really a different case, and I don't see why we
shouldn't do as you are asking.  I've said as much before,
http://www.sourceware.org/ml/binutils/2006-06/msg00017.html,
and a google search turns up at least one bug report about this.

Any dissenting opinions on this issue?

-- 
Alan Modra
Australia Development Lab, IBM


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