diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-10-19 15:44:35 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-10-22 10:14:15 +0200 |
commit | 99ba51255402201c6e193d803ee1f1fc3f2de0e6 (patch) | |
tree | edd16747de26e7b2966162e6c96f13e126999624 /bfd/elf64-s390.c | |
parent | d8ee9e44cc9a986b063a6ea6c91d39217cce65a1 (diff) | |
download | gdb-99ba51255402201c6e193d803ee1f1fc3f2de0e6.zip gdb-99ba51255402201c6e193d803ee1f1fc3f2de0e6.tar.gz gdb-99ba51255402201c6e193d803ee1f1fc3f2de0e6.tar.bz2 |
S/390: ifunc: Redirect local function calls to the IPLT.
bfd/ChangeLog:
* elf32-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
only when linking an executable.
(elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
slot.
* elf64-s390.c (elf_s390_check_relocs): Set the non_got_ref marker
only when linking an executable.
(elf_s390_relocate_section): Redirect PC-relative relocs to a IPLT
slot.
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r-- | bfd/elf64-s390.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 2b62271..bd9c082 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1205,7 +1205,7 @@ elf_s390_check_relocs (bfd *abfd, case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: - if (h != NULL) + if (h != NULL && bfd_link_executable (info)) { /* If this reloc is in a read-only section, we might need a copy reloc. We can't check reliably at this @@ -2718,10 +2718,6 @@ elf_s390_relocate_section (bfd *output_bfd, unresolved_reloc = FALSE; break; - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_64: case R_390_PC16: case R_390_PC12DBL: case R_390_PC16DBL: @@ -2729,6 +2725,24 @@ elf_s390_relocate_section (bfd *output_bfd, case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: + /* The target of these relocs are instruction operands + residing in read-only sections. We cannot emit a runtime + reloc for it. */ + if (h != NULL + && s390_is_ifunc_symbol_p (h) + && h->def_regular + && bfd_link_pic (info)) + { + relocation = (htab->elf.iplt->output_section->vma + + htab->elf.iplt->output_offset + + h->plt.offset); + goto do_relocation; + } + + case R_390_8: + case R_390_16: + case R_390_32: + case R_390_64: if (h != NULL && s390_is_ifunc_symbol_p (h) |