+2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * elf32-s390.c (elf_s390_check_relocs): Fallthrough to the PLT
+ slot allocating code for GOTOFF relocs on ifunc symbols.
+ (elf_s390_gc_sweep_hook): Decrement plt refcount for GOTOFF relocs
+ on ifunc symbols.
+ (elf_s390_relocate_section): Redirect a GOTOFF reloc to an iplt
+ slot.
+
2015-10-22 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR ld/18841
}
switch (r_type)
{
- case R_390_GOTOFF16:
- case R_390_GOTOFF32:
case R_390_GOTPC:
case R_390_GOTPCDBL:
/* These relocs do not need a GOT slot. They just load the
the GOT. Since the GOT pointer has been set up above we
are done. */
break;
+ case R_390_GOTOFF16:
+ case R_390_GOTOFF32:
+ if (h == NULL || !s390_is_ifunc_symbol_p (h) || !h->def_regular)
+ break;
case R_390_PLT12DBL:
case R_390_PLT16DBL:
case R_390_GOTOFF16:
case R_390_GOTOFF32:
+ if (s390_is_ifunc_symbol_p (h) && h->def_regular)
+ {
+ h->plt.refcount--;
+ break;
+ }
+
case R_390_GOTPC:
case R_390_GOTPCDBL:
break;
/* Relocation is relative to the start of the global offset
table. */
+ if (h != NULL
+ && s390_is_ifunc_symbol_p (h)
+ && h->def_regular
+ && !bfd_link_executable (info))
+ {
+ relocation = (htab->elf.iplt->output_section->vma
+ + htab->elf.iplt->output_offset
+ + h->plt.offset
+ - htab->elf.sgot->output_section->vma);
+ goto do_relocation;
+ }
+
/* Note that sgot->output_offset is not involved in this
calculation. We always want the start of .got. If we
defined _GLOBAL_OFFSET_TABLE in a different way, as is