]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
authorIan Lance Taylor <ian@airs.com>
Mon, 19 Jul 1999 19:08:33 +0000 (19:08 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 19 Jul 1999 19:08:33 +0000 (19:08 +0000)
if they appear to be specially created by the linker.

bfd/ChangeLog
bfd/elflink.h

index f355ed9244925238628ad1da1f2aac2b1e8bdf97..64e62070fb4bc48833aa5aea6f8410c81e68241f 100644 (file)
@@ -1,3 +1,8 @@
+1999-07-19  Ian Lance Taylor  <ian@zembu.com>
+
+       * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD
+       if they appear to be specially created by the linker.
+
 1999-07-19  Nick Clifton  <nickc@cygnus.com>
 
        * targets.c (alternative_target): New field in bfd_target
index 1e88b6318ae64efd989d4d8cdd2b4148a1eb8dc5..6fb9bbae8a184bd3c748c8bddf10d296ef94cb13 100644 (file)
@@ -368,8 +368,12 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
   /* 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
-     itself.  */
-  if (abfd == oldbfd)
+     itself.  The additional tests catch cases like
+     _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a
+     dynamic object, which we do want to handle here.  */
+  if (abfd == oldbfd
+      && ((abfd->flags & DYNAMIC) == 0
+         || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))
     return true;
 
   /* NEWDYN and OLDDYN indicate whether the new or old symbol,