PR19886, --as-needed regression
authorAlan Modra <amodra@gmail.com>
Fri, 1 Apr 2016 06:38:45 +0000 (17:08 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 1 Apr 2016 12:50:12 +0000 (23:20 +1030)
commit7b15fa7ac802f430f7fb7c2b77f40ab78c2e4018
treeba488940ff109deeaed2af061bb413123c9ab25d
parent6d4af3c269e64b0093b23bd63d302bd9f90de6a9
PR19886, --as-needed regression

This isn't perfect in checking whether libraries will be loaded since
elf_link_add_object_symbols doesn't recurse down DT_NEEDED links.
(That happens later in ld/emultempl/elf32.em after_open.)  So in
effect this recursive check really only looks one level down the
DT_NEEDED tree.  Which is enough for the most common case, and
libc.so/ld.so in particular.

PR 19886
* elflink.c (on_needed_list): Recursively check needed status.
(elf_link_add_object_symbols): Adjust.
bfd/ChangeLog
bfd/elflink.c