Index: bfd/elflink.c =================================================================== RCS file: /cvs/src/src/bfd/elflink.c,v retrieving revision 1.371 diff -u -p -u -p -r1.371 elflink.c --- bfd/elflink.c 21 Mar 2010 23:26:33 -0000 1.371 +++ bfd/elflink.c 1 Apr 2010 15:46:51 -0000 @@ -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;