summaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
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 cccc5cad25..a440647a5e 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;