aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2007-07-23 09:56:19 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2007-07-23 09:56:19 +0000
commita26587bab514ebd91e3463018462acc6855826f1 (patch)
tree0311bc63776a670e00cdc3730b3c9e520722b7c7 /bfd
parent07a5aea53e1b1d0d2148ed6a49e18d141dc504b0 (diff)
downloadgdb-a26587bab514ebd91e3463018462acc6855826f1.zip
gdb-a26587bab514ebd91e3463018462acc6855826f1.tar.gz
gdb-a26587bab514ebd91e3463018462acc6855826f1.tar.bz2
bfd/
* 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6dce330..5d3c939 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a68d736..cd8b756 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -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;