diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2007-07-23 09:56:19 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@nildram.co.uk> | 2007-07-23 09:56:19 +0000 |
commit | 658bce721fd432f3a7f1b657be834c21f4aecbe9 (patch) | |
tree | bfc7c0d5d52d56dcfba9384bd5816b88eb68d525 /bfd | |
parent | bee09e30176a0d5c776df1a0f78ece22a7168eaf (diff) | |
download | gdb-658bce721fd432f3a7f1b657be834c21f4aecbe9.tar.gz |
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/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6dce3309397..5d3c9392285 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 a68d736ab5a..cd8b756d66c 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; |