aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-03-18 02:47:03 +0000
committerAlan Modra <amodra@gmail.com>2013-03-18 02:47:03 +0000
commitffa9430db119a35786d64ffa50af9c2c368d210f (patch)
tree5dfa83c0fe14863d865cc98001560a5365108836 /bfd
parentf7f9535d8d2073ca2040997a16f17944e05ec940 (diff)
downloadgdb-ffa9430db119a35786d64ffa50af9c2c368d210f.zip
gdb-ffa9430db119a35786d64ffa50af9c2c368d210f.tar.gz
gdb-ffa9430db119a35786d64ffa50af9c2c368d210f.tar.bz2
PR ld/12549
bfd/ * elflink.c (elf_link_add_object_symbols): Exclude weak refs when considering whether an --as-needed library is needed. ld/ * ld.texinfo (--as-needed): Update. ld/testsuite/ * ld-elf/pr14862.out: Expect no output.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 40bb0a1..b710f3c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-18 Alan Modra <amodra@gmail.com>
+
+ PR ld/12549
+ * elflink.c (elf_link_add_object_symbols): Exclude weak refs when
+ considering whether an --as-needed library is needed.
+
2013-03-14 Tom Tromey <tromey@redhat.com>
* opncls.c (bfd_get_debug_link_info): Rename from
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ba65f21..8055d26 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4482,10 +4482,10 @@ error_free_dyn:
if (!add_needed
&& definition
&& ((dynsym
- && h->ref_regular
+ && h->ref_regular_nonweak
&& (undef_bfd == NULL
|| (undef_bfd->flags & BFD_PLUGIN) == 0))
- || (h->ref_dynamic
+ || (h->ref_dynamic_nonweak
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
&& !on_needed_list (elf_dt_name (abfd), htab->needed))))
{