From: Matthew Gretton-Dann Date: Wed, 14 Apr 2010 08:29:33 +0000 (+0000) Subject: * bfd/elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early X-Git-Tag: sid-snapshot-20100501~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=895fa45f398c6815252ed56c8a1b7992f40ccaa0;p=platform%2Fupstream%2Fbinutils.git * bfd/elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early exit due to merging the same weak symbol to test that the symbols are actually weak. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b56b279..3ec74f2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2010-04-14 Matthew Gretton-Dann + + * elflink.c (_bfd_elf_merge_symbol): Tighten up the test for early + exit due to merging the same weak symbol to test that the symbols are + actually weak. + 2010-04-13 Alan Modra * elf64-ppc.c (ppc64_elf_relocate_section): Correct NOP location diff --git a/bfd/elflink.c b/bfd/elflink.c index 98ea753..f445912 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1013,6 +1013,11 @@ _bfd_elf_merge_symbol (bfd *abfd, break; } + /* Differentiate strong and weak symbols. */ + newweak = bind == STB_WEAK; + oldweak = (h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_undefweak); + /* In cases involving weak versioned symbols, we may wind up trying to merge a symbol with itself. Catch that here, to avoid the confusion that results if we try to override a symbol with @@ -1020,6 +1025,7 @@ _bfd_elf_merge_symbol (bfd *abfd, _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a dynamic object, which we do want to handle here. */ if (abfd == oldbfd + && (newweak || oldweak) && ((abfd->flags & DYNAMIC) == 0 || !h->def_regular)) return TRUE; @@ -1241,11 +1247,6 @@ _bfd_elf_merge_symbol (bfd *abfd, return TRUE; } - /* Differentiate strong and weak symbols. */ - newweak = bind == STB_WEAK; - oldweak = (h->root.type == bfd_link_hash_defweak - || h->root.type == bfd_link_hash_undefweak); - if (bind == STB_GNU_UNIQUE) h->unique_global = 1;