diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-08-27 07:59:48 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-08-27 07:59:48 -0700 |
commit | c8831961f9fecf81e90fe7c8c94b47e01ee64662 (patch) | |
tree | 22fb029acee0d6388275d2628613dd74bfaa2063 /bfd | |
parent | 29a9f53e857c5d55df852d0a5d5c41a9247c16a2 (diff) | |
download | gdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.zip gdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.tar.gz gdb-c8831961f9fecf81e90fe7c8c94b47e01ee64662.tar.bz2 |
Use bfd_is_abs_section to check discarded input section
bfd/
PR ld/17306
* elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section
to check discarded input section.
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
ld/testsuite/
PR ld/17306
* ld-i386/i386.exp (i386tests): Add tests for PR ld/17306.
* ld-x86-64/x86-64.exp (x86_64tests): Likewise.
* ld-i386/pr17306a.s: New file.
* ld-i386/pr17306b.s: Likewise.
* ld-x86-64/pr17306a.s: Likewise.
* ld-x86-64/pr17306b.s: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 2 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3f81ba4..bba079f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2014-08-27 H.J. Lu <hongjiu.lu@intel.com> + PR ld/17306 + * elf32-i386.c (elf_i386_convert_mov_to_lea): Use bfd_is_abs_section + to check discarded input section. + * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. + +2014-08-27 H.J. Lu <hongjiu.lu@intel.com> + PR ld/17313 * elflink.c (elf_link_add_object_symbols): Don't attach dynamic sections to input from ld --just-symbols. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 7c4b4bb..a00d47c 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2533,7 +2533,7 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec, /* Nothing to do if there are no codes, no relocations or no output. */ if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC) || sec->reloc_count == 0 - || discarded_section (sec)) + || bfd_is_abs_section (sec->output_section)) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index f71291e..9d18a54 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -2777,7 +2777,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec, /* Nothing to do if there are no codes, no relocations or no output. */ if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC) || sec->reloc_count == 0 - || discarded_section (sec)) + || bfd_is_abs_section (sec->output_section)) return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; |