forked from Imagelibrary/binutils-gdb
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user