diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-02-16 17:48:57 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2013-02-16 17:48:57 +0000 |
commit | 313ed4a9b06a7080664ebe5ff040a6fd56c6d5d8 (patch) | |
tree | 5cba0e781b5e092567357a9bc67504806fa83f92 /bfd | |
parent | 983dc440fe154776689b12ff1342f8e41346ed48 (diff) | |
download | gdb-313ed4a9b06a7080664ebe5ff040a6fd56c6d5d8.zip gdb-313ed4a9b06a7080664ebe5ff040a6fd56c6d5d8.tar.gz gdb-313ed4a9b06a7080664ebe5ff040a6fd56c6d5d8.tar.bz2 |
Also track weak references
PR ld/15149
* elflink.c (elf_link_add_object_symbols): Also track weak
references.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elflink.c | 21 |
2 files changed, 18 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 72d12ef..c6fb5b1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2013-02-16 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/15149 + * elflink.c (elf_link_add_object_symbols): Also track weak + references. + 2013-02-15 H.J. Lu <hongjiu.lu@intel.com> PR binutils/15151 diff --git a/bfd/elflink.c b/bfd/elflink.c index d423ca4..1a45110 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4002,15 +4002,17 @@ error_free_dyn: bfd_boolean skip; /* If this is a definition of a symbol which was previously - referenced in a non-weak manner then make a note of the bfd - that contained the reference. This is used if we need to - refer to the source of the reference later on. */ + referenced, then make a note of the bfd that contained the + reference. This is used if we need to refer to the source + of the reference later on. */ if (! bfd_is_und_section (sec)) { - h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE); + h = elf_link_hash_lookup (elf_hash_table (info), name, + FALSE, FALSE, FALSE); if (h != NULL - && h->root.type == bfd_link_hash_undefined + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) && h->root.u.undef.abfd) undef_bfd = h->root.u.undef.abfd; } @@ -4123,14 +4125,15 @@ error_free_dyn: } /* If necessary, make a second attempt to locate the bfd - containing an unresolved, non-weak reference to the - current symbol. */ + containing an unresolved reference to the current symbol. */ if (! bfd_is_und_section (sec) && undef_bfd == NULL) { - h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE, FALSE); + h = elf_link_hash_lookup (elf_hash_table (info), name, + FALSE, FALSE, FALSE); if (h != NULL - && h->root.type == bfd_link_hash_undefined + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) && h->root.u.undef.abfd) undef_bfd = h->root.u.undef.abfd; } |