2004-12-01 Paul Brook <paul@codesourcery.com>
bfd/ * elflink.c (elf_link_add_object_symbols): Make symbols from discarded sections undefined. ld/testsuite/ * ld-elf/group1.d: New test. * ld-elf/group.ld, ld-elf/group1a.s, ld-elf/group1b.s: New test.
This commit is contained in:
parent
24b4912d64
commit
529fcb9585
7 changed files with 40 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-12-01 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
* elflink.c (elf_link_add_object_symbols): Make symbols from discarded
|
||||
sections undefined.
|
||||
|
||||
2004-11-30 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
* elf32-arm.c (struct elf32_arm_link_hash_table): Remove
|
||||
|
|
|
@ -3425,6 +3425,12 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
|
|||
sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
|
||||
if (sec == NULL)
|
||||
sec = bfd_abs_section_ptr;
|
||||
else if (sec->kept_section)
|
||||
{
|
||||
/* Symbols from discarded section are undefined. */
|
||||
sec = bfd_und_section_ptr;
|
||||
isym->st_shndx = SHN_UNDEF;
|
||||
}
|
||||
else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
|
||||
value -= sec->vma;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2004-12-01 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
* ld-elf/group1.d: New test.
|
||||
* ld-elf/group.ld, ld-elf/group1a.s, ld-elf/group1b.s: New test.
|
||||
|
||||
2004-12-01 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* ld-selective/selective.exp: Use -print-libgcc-file-name for
|
||||
|
|
5
ld/testsuite/ld-elf/group.ld
Normal file
5
ld/testsuite/ld-elf/group.ld
Normal file
|
@ -0,0 +1,5 @@
|
|||
SECTIONS
|
||||
{
|
||||
. = 0x1000;
|
||||
.text : { *(.text) }
|
||||
}
|
9
ld/testsuite/ld-elf/group1.d
Normal file
9
ld/testsuite/ld-elf/group1.d
Normal file
|
@ -0,0 +1,9 @@
|
|||
#source: group1a.s
|
||||
#source: group1b.s
|
||||
#ld: -T group.ld
|
||||
#readelf: -s
|
||||
Symbol table '.symtab' contains .* entries:
|
||||
#...
|
||||
.*: 00001000 0 NOTYPE WEAK DEFAULT . foo
|
||||
.*: 00000000 0 NOTYPE GLOBAL DEFAULT UND bar
|
||||
#...
|
4
ld/testsuite/ld-elf/group1a.s
Normal file
4
ld/testsuite/ld-elf/group1a.s
Normal file
|
@ -0,0 +1,4 @@
|
|||
.section .text,"axG",%progbits,foo_group,comdat
|
||||
.weak foo
|
||||
foo:
|
||||
.word 0
|
6
ld/testsuite/ld-elf/group1b.s
Normal file
6
ld/testsuite/ld-elf/group1b.s
Normal file
|
@ -0,0 +1,6 @@
|
|||
.section .text,"axG",%progbits,foo_group,comdat
|
||||
.global foo
|
||||
.global bar
|
||||
foo:
|
||||
.word 0
|
||||
bar:
|
Loading…
Reference in a new issue