Check if symbol is defined when converting mov to lea
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index aad324490c994ca271eba2ee02d01f57b5d79d8b..dc5fd0db4309d105114878b9ffee1996d6261dba 100644 (file)
@@ -3074,7 +3074,9 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
          /* STT_GNU_IFUNC must keep R_X86_64_GOTPCREL relocation.  We also
             avoid optimizing _DYNAMIC since ld.so may use its link-time
             address.  */
-         if (h->type != STT_GNU_IFUNC
+         if ((h->root.type == bfd_link_hash_defined
+              || h->root.type == bfd_link_hash_defweak)
+             && h->type != STT_GNU_IFUNC
              && h != htab->elf.hdynamic
              && SYMBOL_REFERENCES_LOCAL (link_info, h))
            {
This page took 0.025244 seconds and 4 git commands to generate.