aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-09-18 00:41:59 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-09-18 00:41:59 +0000
commitfbdc86d9c9e5fe451861a34381bf5483aec43bf1 (patch)
tree40a06654586a4d12f839831032a4bdab36c5a7e4 /bfd/elf64-x86-64.c
parent6bf93ee5094e7111d78339821ce2321060caef5a (diff)
downloadgdb-fbdc86d9c9e5fe451861a34381bf5483aec43bf1.zip
gdb-fbdc86d9c9e5fe451861a34381bf5483aec43bf1.tar.gz
gdb-fbdc86d9c9e5fe451861a34381bf5483aec43bf1.tar.bz2
Ignore discarded section when converting mov to lea
* elf32-i386.c (elf_i386_convert_mov_to_lea): Ignore discarded section. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index cccc5ca..a440647 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2595,9 +2595,10 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
if (!is_elf_hash_table (link_info->hash))
return FALSE;
- /* Nothing to do if there are no codes or no relocations. */
+ /* 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)
+ || sec->reloc_count == 0
+ || discarded_section (sec))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;