Updated sources to avoid using the identifier name "new", which is a
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index de6f6ecd242a2735dda536e73698b8e51e85bde5..6db647207b4b19a6e25cf899e5a9cfdf17fad730 100644 (file)
@@ -3716,6 +3716,23 @@ elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd,
 {
   struct elf64_x86_64_link_hash_table *htab;
 
+  /* PR 10433: STT_GNU_IFUNC symbols must go through the PLT
+     only when they are referenced, not when they are defined.  */
+  if (h->type == STT_GNU_IFUNC
+      && h->def_regular
+      && ! h->ref_regular
+      && ! info->relocatable)
+    {
+      if (! ((h->dynindx != -1
+             || h->forced_local)
+            && ((info->shared
+                 && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+                     || h->root.type != bfd_link_hash_undefweak))
+                || ! h->forced_local)
+            && elf_hash_table (info)->dynamic_sections_created))
+       return TRUE;
+    }
+
   htab = elf64_x86_64_hash_table (info);
 
   if (h->plt.offset != (bfd_vma) -1)
This page took 0.026628 seconds and 4 git commands to generate.