bfd/
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Apr 2005 16:44:08 +0000 (16:44 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Apr 2005 16:44:08 +0000 (16:44 +0000)
2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>

* elflink.c (elf_link_input_bfd): Update check for removed
sections.

ld/testsuite/

2005-04-13  H.J. Lu  <hongjiu.lu@intel.com>

* ld-elf/empty.d: New file.
* ld-elf/empty.s: Likewise.

bfd/ChangeLog
bfd/elflink.c
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/empty.d [new file with mode: 0644]
ld/testsuite/ld-elf/empty.s [new file with mode: 0644]

index 75ff150cbd3e72f142927f44e3754b8722a38b89..1167827e515272b7bd9138342b72ea4216a69675 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * elflink.c (elf_link_input_bfd): Update check for removed
+       sections.
+
 2005-04-12  Alan Modra  <amodra@bigpond.net.au>
 
        * Makefile.am: Run "make dep-am".
index d37b19ba92ac1ca4d048252addd9cfb85424357d..09d06167fa55772941d59a21c3ff2c5daa8b54df 100644 (file)
@@ -6869,6 +6869,11 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                  && (isec->flags & SEC_EXCLUDE) != 0)))
        continue;
 
+      /* If the section is not in the output BFD's section list, it is not
+        being output.  */
+      if (bfd_section_removed_from_list (output_bfd, isec->output_section))
+       continue;
+
       /* Get the name of the symbol.  */
       name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link,
                                              isym->st_name);
index 6ac830cbeabcb517bf89d6c18c6578783d8a5bca..1c0c370c88709b01aa2836dc764d1568413044a0 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * ld-elf/empty.d: New file.
+       * ld-elf/empty.s: Likewise.
+
 2005-04-11  David S. Miller  <davem@davemloft.net>
 
        * ld-sparc/tlssunbin32.dd: Update for TLS relocation fixes.
diff --git a/ld/testsuite/ld-elf/empty.d b/ld/testsuite/ld-elf/empty.d
new file mode 100644 (file)
index 0000000..ecf8aea
--- /dev/null
@@ -0,0 +1,7 @@
+#source: empty.s
+#ld:
+#readelf: -s
+
+#...
+[      ]+[0-9]+:[      ]+[0-9a-f]+[    ]+[0-9]+[       ]+FUNC[  ]+GLOBAL DEFAULT[      ]+[1-9] _start
+#pass
diff --git a/ld/testsuite/ld-elf/empty.s b/ld/testsuite/ld-elf/empty.s
new file mode 100644 (file)
index 0000000..3176f66
--- /dev/null
@@ -0,0 +1,10 @@
+       .section .bss
+bar:
+       .text
+       .type _start,"function"
+       .global _start
+_start:
+       .type __start,"function"
+       .global __start
+__start:
+       .long 0