OSDN Git Service

bfd/
authorRichard Sandiford <rsandifo@nildram.co.uk>
Mon, 23 Jul 2007 09:56:19 +0000 (09:56 +0000)
committerRichard Sandiford <rsandifo@nildram.co.uk>
Mon, 23 Jul 2007 09:56:19 +0000 (09:56 +0000)
* elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
of weakdef->root.type if weakdef has no regular definition.

ld/testsuite/
* ld-elf/weak-dyn-1a.s, ld-elf/weak-dyn-1b.s, ld-elf/weak-dyn-1.ld,
* ld-elf/weak-dyn-1.rd: New test.
* ld-elf/elf.exp: Run it.

bfd/ChangeLog
bfd/elflink.c

index 6dce330..5d3c939 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-23  Richard Sandiford  <richard@codesourcery.com>
+
+       * elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
+       of weakdef->root.type if weakdef has no regular definition.
+
 2007-07-22  Adam Nemet  <anemet@caviumnetworks.com>
 
        * elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
index a68d736..cd8b756 100644 (file)
@@ -2492,8 +2492,6 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
 
       BFD_ASSERT (h->root.type == bfd_link_hash_defined
                  || h->root.type == bfd_link_hash_defweak);
-      BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
-                 || weakdef->root.type == bfd_link_hash_defweak);
       BFD_ASSERT (weakdef->def_dynamic);
 
       /* If the real definition is defined by a regular object file,
@@ -2502,8 +2500,11 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
       if (weakdef->def_regular)
        h->u.weakdef = NULL;
       else
-       (*bed->elf_backend_copy_indirect_symbol) (eif->info, weakdef,
-                                                 h);
+       {
+         BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined
+                     || weakdef->root.type == bfd_link_hash_defweak);
+         (*bed->elf_backend_copy_indirect_symbol) (eif->info, weakdef, h);
+       }
     }
 
   return TRUE;