mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 13:56:22 +08:00
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.
This commit is contained in:
@ -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>
|
2007-07-22 Adam Nemet <anemet@caviumnetworks.com>
|
||||||
|
|
||||||
* elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
|
* elfxx-mips.c (struct mips_elf_link_hash_table): Add new field
|
||||||
|
@ -2492,8 +2492,6 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|
|||||||
|
|
||||||
BFD_ASSERT (h->root.type == bfd_link_hash_defined
|
BFD_ASSERT (h->root.type == bfd_link_hash_defined
|
||||||
|| h->root.type == bfd_link_hash_defweak);
|
|| 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);
|
BFD_ASSERT (weakdef->def_dynamic);
|
||||||
|
|
||||||
/* If the real definition is defined by a regular object file,
|
/* 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)
|
if (weakdef->def_regular)
|
||||||
h->u.weakdef = NULL;
|
h->u.weakdef = NULL;
|
||||||
else
|
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;
|
return TRUE;
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2007-07-23 Richard Sandiford <richard@codesourcery.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2007-07-13 Nathan Sidwell <nathan@codesourcery.com>
|
2007-07-13 Nathan Sidwell <nathan@codesourcery.com>
|
||||||
|
|
||||||
* ld-scripts/assert.t: Tweak to avoid relying on empty's VMA being
|
* ld-scripts/assert.t: Tweak to avoid relying on empty's VMA being
|
||||||
|
@ -36,6 +36,19 @@ foreach t $test_list {
|
|||||||
run_dump_test [file rootname $t]
|
run_dump_test [file rootname $t]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { [istarget *-*-linux*] } {
|
||||||
|
run_ld_link_tests {
|
||||||
|
{"Weak symbols in dynamic objects 1 (support)"
|
||||||
|
"-shared" "" {weak-dyn-1a.s}
|
||||||
|
{}
|
||||||
|
"libweakdyn1a.so"}
|
||||||
|
{"Weak symbols in dynamic objects 1 (main test)"
|
||||||
|
"-shared tmpdir/libweakdyn1a.so -Tweak-dyn-1.ld" "" {weak-dyn-1b.s}
|
||||||
|
{{readelf {--relocs --wide} weak-dyn-1.rd}}
|
||||||
|
"libweakdyn1b.so"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# The following tests require running the executable generated by ld.
|
# The following tests require running the executable generated by ld.
|
||||||
if ![isnative] {
|
if ![isnative] {
|
||||||
return
|
return
|
||||||
|
8
ld/testsuite/ld-elf/weak-dyn-1.ld
Normal file
8
ld/testsuite/ld-elf/weak-dyn-1.ld
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = 0x800000;
|
||||||
|
PROVIDE (bar = .);
|
||||||
|
.data : {
|
||||||
|
*(.data)
|
||||||
|
}
|
||||||
|
}
|
3
ld/testsuite/ld-elf/weak-dyn-1.rd
Normal file
3
ld/testsuite/ld-elf/weak-dyn-1.rd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#...
|
||||||
|
0+800000 .* foo.*
|
||||||
|
#pass
|
13
ld/testsuite/ld-elf/weak-dyn-1a.s
Normal file
13
ld/testsuite/ld-elf/weak-dyn-1a.s
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.globl foo
|
||||||
|
.weak foo
|
||||||
|
.type foo,%object
|
||||||
|
.size foo,1
|
||||||
|
|
||||||
|
.globl bar
|
||||||
|
.type bar,%object
|
||||||
|
.size bar,1
|
||||||
|
|
||||||
|
.data
|
||||||
|
foo:
|
||||||
|
bar:
|
||||||
|
.dc.a data_begin
|
3
ld/testsuite/ld-elf/weak-dyn-1b.s
Normal file
3
ld/testsuite/ld-elf/weak-dyn-1b.s
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.data
|
||||||
|
.dc.a foo
|
||||||
|
.dc.a data_begin
|
Reference in New Issue
Block a user