aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-s390.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-03-09 14:37:36 +0000
committerNick Clifton <nickc@redhat.com>2018-03-09 14:37:36 +0000
commitf657f8c4a1dc0ac69b16b1dc6eacbf5286f1f0a0 (patch)
treecd660cfaf14687bc4785722975206591959142d8 /bfd/elf64-s390.c
parent9bd8e0b072ad5fc5b8956fd5d3e51dc5a9b0f236 (diff)
downloadgdb-f657f8c4a1dc0ac69b16b1dc6eacbf5286f1f0a0.zip
gdb-f657f8c4a1dc0ac69b16b1dc6eacbf5286f1f0a0.tar.gz
gdb-f657f8c4a1dc0ac69b16b1dc6eacbf5286f1f0a0.tar.bz2
Fix Sparc, s390 and AArch64 targets so that they can handle relocs against ifunc symbols found in note sections.
Following on from PR 22929, I have found the same problem exists with other ifunc supporting targets too. Plus see this link for the bug being reported against the s390x binutils for Fedora rawhide: https://bugzilla.redhat.com/show_bug.cgi?id=1553705 So I am going to check in the patch below which applies the same change that H.J. made for the x86_64 target to the other affected targets. (Specifically: S390, AArch64 and Sparc). Plus it adds a new test to the linker testsuite to make sure that this problem stays fixed. bfd * elf64-s390.c (elf_s390_relocate_section): Move check for relocations against non-allocated sections to before the code that handles ifunc relocations. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Treat relocs against IFUNC symbols in non-allocated sections as relocs against FUNC symbols. * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise. ld * testsuite/ld-ifunc/ifuncmod5.s: New test. Checks that targets that support IFUNC symbols can handle relocations against those symbols in NOTE sections. * testsuite/ld-ifunc/ifuncmod5.d: New file: Driver for the new test. * testsuite/ld-ifunc/ifunc.exp: Run the new test.
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r--bfd/elf64-s390.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 9eca035..2d02e82 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -2565,6 +2565,9 @@ elf_s390_relocate_section (bfd *output_bfd,
case R_390_32:
case R_390_64:
+ if ((input_section->flags & SEC_ALLOC) == 0)
+ break;
+
if (h != NULL
&& s390_is_ifunc_symbol_p (h)
&& h->def_regular)
@@ -2627,9 +2630,6 @@ elf_s390_relocate_section (bfd *output_bfd,
}
}
- if ((input_section->flags & SEC_ALLOC) == 0)
- break;
-
if ((bfd_link_pic (info)
&& (h == NULL
|| (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT