diff options
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index f864834d250..269bce5cd78 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -3116,6 +3116,8 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec, } else { + bfd_boolean defined; + indx = r_symndx - symtab_hdr->sh_info; h = elf_sym_hashes (abfd)[indx]; BFD_ASSERT (h != NULL); @@ -3124,19 +3126,17 @@ elf_x86_64_convert_load (bfd *abfd, asection *sec, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + defined = bfd_link_get_defined_symbol (abfd, &h->root, + &tsec, &toff); + /* STT_GNU_IFUNC must keep GOTPCREL relocations. We also avoid optimizing GOTPCREL relocations againt _DYNAMIC since ld.so may use its link-time address. */ - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (defined && h->type != STT_GNU_IFUNC && h != htab->elf.hdynamic && SYMBOL_REFERENCES_LOCAL (link_info, h)) - { - tsec = h->root.u.def.section; - toff = h->root.u.def.value; - symtype = h->type; - } + symtype = h->type; else continue; } |