OSDN Git Service

2004-12-01 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Wed, 1 Dec 2004 23:23:11 +0000 (23:23 +0000)
committerPaul Brook <paul@codesourcery.com>
Wed, 1 Dec 2004 23:23:11 +0000 (23:23 +0000)
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.

bfd/ChangeLog
bfd/elflink.c

index 6a1d301..dc0d933 100644 (file)
@@ -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
index b095312..6e87596 100644 (file)
@@ -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;
        }