In r253839 the default behaviour of ld(1) was changed such that all
authortijl <tijl@FreeBSD.org>
Thu, 28 Aug 2014 18:33:42 +0000 (18:33 +0000)
committertijl <tijl@FreeBSD.org>
Thu, 28 Aug 2014 18:33:42 +0000 (18:33 +0000)
commitf71e540b0abc8ec3c7b1f9d2d0283201ea3a426a
treef8af595bb04d671b3824a1e5ba704d60739b2594
parent3a41cafaa4e5cbeb02b6155fe42148041b4ef966
In r253839 the default behaviour of ld(1) was changed such that all
libraries that need to be linked into an executable or library have to be
listed on the command line explicitly.  This commit fixes a bug in ld(1)
where it would scan dependencies of the libraries on the command line and
link them if needed if they were also found in ld.so.cache.

The important bit of the patch is the initialisation of needed.by such that
libraries found by scanning dependencies are marked as such and not used in
the link.

The patch is a backport of binutils git commit
d5c8b1f8561426b41aa5330ed60f578178fe6be2

The author gave permission to use it under GPLv2 terms.

PR: 192062
Exp-run by: antoine
MFC after: 1 week
contrib/binutils/ld/emultempl/elf32.em