* elf.c (_bfd_elf_map_sections_to_segments): Don't load program
[deliverable/binutils-gdb.git] / bfd / elf-ifunc.c
index 0de236f8c2743fbb7dd4497e620bb2688e51b1e0..760fc26c1a158b7cb7aebc67a02db933ccaedd22 100644 (file)
@@ -187,6 +187,15 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info,
 
   htab = elf_hash_table (info);
 
+  /* Support garbage collection against STT_GNU_IFUNC symbols.  */
+  if (h->plt.refcount <= 0 && h->got.refcount <= 0)
+    {
+      h->got = htab->init_got_offset;
+      h->plt = htab->init_plt_offset;
+      *head = NULL;
+      return TRUE;
+    }
+
   /* Return and discard space for dynamic relocations against it if
      it is never referenced in a non-shared object.  */
   if (!h->ref_regular)
This page took 0.023905 seconds and 4 git commands to generate.