From e75a280b02f870156957a6fa46cd7888714698ef Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 13 Apr 2005 16:44:08 +0000 Subject: [PATCH] bfd/ 2005-04-13 Daniel Jacobowitz * elflink.c (elf_link_input_bfd): Update check for removed sections. ld/testsuite/ 2005-04-13 H.J. Lu * ld-elf/empty.d: New file. * ld-elf/empty.s: Likewise. --- bfd/ChangeLog | 5 +++++ bfd/elflink.c | 5 +++++ ld/testsuite/ChangeLog | 5 +++++ ld/testsuite/ld-elf/empty.d | 7 +++++++ ld/testsuite/ld-elf/empty.s | 10 ++++++++++ 5 files changed, 32 insertions(+) create mode 100644 ld/testsuite/ld-elf/empty.d create mode 100644 ld/testsuite/ld-elf/empty.s diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 75ff150cbd3..1167827e515 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2005-04-13 Daniel Jacobowitz + + * elflink.c (elf_link_input_bfd): Update check for removed + sections. + 2005-04-12 Alan Modra * Makefile.am: Run "make dep-am". diff --git a/bfd/elflink.c b/bfd/elflink.c index d37b19ba92a..09d06167fa5 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -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); diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 6ac830cbeab..1c0c370c887 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-13 H.J. Lu + + * ld-elf/empty.d: New file. + * ld-elf/empty.s: Likewise. + 2005-04-11 David S. Miller * 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 index 00000000000..ecf8aea92a6 --- /dev/null +++ b/ld/testsuite/ld-elf/empty.d @@ -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 index 00000000000..3176f66d9d4 --- /dev/null +++ b/ld/testsuite/ld-elf/empty.s @@ -0,0 +1,10 @@ + .section .bss +bar: + .text + .type _start,"function" + .global _start +_start: + .type __start,"function" + .global __start +__start: + .long 0 -- 2.30.2