From a1ae7f0b0b6d550c700ecb75b9a3573adc4ae5fd Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 18 Sep 2012 00:41:56 +0000 Subject: 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. --- bfd/elf32-i386.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bfd/elf32-i386.c') diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 59feea2871..eb90a91c2d 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2559,9 +2559,10 @@ elf_i386_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; -- cgit v1.2.1