* linker.c (_bfd_generic_link_add_one_symbol): Ignore
authorIan Lance Taylor <ian@airs.com>
Wed, 11 Jan 1995 19:38:06 +0000 (19:38 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 11 Jan 1995 19:38:06 +0000 (19:38 +0000)
redefinitions of an absolute symbol to the same value.
PR 6159.

bfd/ChangeLog
bfd/linker.c

index 8d8d3f95b8710ced1e4f49749c2944086897cb03..213aaeaa2af24d1056f311afc6f0cd8f113403b9 100644 (file)
@@ -1,3 +1,8 @@
+Wed Jan 11 14:36:41 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
+
+       * linker.c (_bfd_generic_link_add_one_symbol): Ignore
+       redefinitions of an absolute symbol to the same value.
+
 Mon Jan  9 15:51:32 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
 
        * elfcode.h (elf_link_add_object_symbols): It's reasonable for no
index 760653464504f574cc9d9e6d47f7ff956c602bc8..37ab1c8e2706337e7b4d7074a63ea270515a6c5e 100644 (file)
@@ -867,6 +867,9 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn)
 
   if (! bfd_has_map (abfd))
     {
+      /* An empty archive is a special case.  */
+      if (bfd_openr_next_archived_file (abfd, (bfd *) NULL) == NULL)
+       return true;
       bfd_set_error (bfd_error_no_symbols);
       return false;
     }
@@ -1639,7 +1642,15 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
              default:
                abort ();
              }
-             
+
+           /* Ignore a redefinition of an absolute symbol to the same
+               value; it's harmless.  */
+           if (h->type == bfd_link_hash_defined
+               && bfd_is_abs_section (msec)
+               && bfd_is_abs_section (section)
+               && value == mval)
+             break;
+
            if (! ((*info->callbacks->multiple_definition)
                   (info, name, msec->owner, msec, mval, abfd, section,
                    value)))