This is the mail archive of the
mailing list for the binutils project.
Re: library dependencies and --as-needed
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Brian Gough <bjg at gnu dot org>
- Cc: binutils at sourceware dot org, bug-gsl at gnu dot org, Sébastien Fabbro <bicatali at gentoo dot org>
- Date: Fri, 30 Jan 2009 15:20:41 +1030
- Subject: Re: library dependencies and --as-needed
- References: <email@example.com>
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
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
--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,
and a google search turns up at least one bug report about this.
Any dissenting opinions on this issue?
Australia Development Lab, IBM