]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
IBM zSystems: Rewrite l(g)rl @GOTENT to larl for --no-pie
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 10 Jun 2024 13:33:48 +0000 (15:33 +0200)
committerIlya Leoshkevich <iii@linux.ibm.com>
Mon, 10 Jun 2024 20:37:06 +0000 (22:37 +0200)
commit48e63b875381cdb7acaa8ec27b0a426e5eff6b7d
treefb55508b27f9efe39635cdf7a34cfe2064459fce
parentc4c093a31f6252df4ce7b1e23da4a4290c852c51
IBM zSystems: Rewrite l(g)rl @GOTENT to larl for --no-pie

Regtested on s390x-redhat-linux.

Rewriting l(g)rl @GOTENT to larl is unnecessarily guarded by
bfd_link_pic().  There were no use cases for this in the past, but
since recently the Linux Kernel on s390x is compiled with -fPIE
and linked with --no-pie.  Remove the unnecessary bfd_link_pic()
check.

bfd/ChangeLog:

        * elf32-s390.c (elf_s390_relocate_section): Don't check for
bfd_link_pic() when rewriting lrl@GOTENT to larl.
(elf_s390_finish_dynamic_symbol): Emit a relative reloc for
the above case.
        * elf64-s390.c (elf_s390_relocate_section): Don't check for
bfd_link_pic() when rewriting lgrl@GOTENT to larl.
(elf_s390_finish_dynamic_symbol): Emit a relative reloc for
the above case.

ld/ChangeLog:

* testsuite/ld-s390/s390.exp: Hook up the new tests.
        * testsuite/ld-s390/gotreloc_31-no-pie-1.dd: New test.
        * testsuite/ld-s390/gotreloc_64-no-pie-1.dd: New test.
bfd/elf32-s390.c
bfd/elf64-s390.c
ld/testsuite/ld-s390/gotreloc_31-no-pie-1.dd [new file with mode: 0644]
ld/testsuite/ld-s390/gotreloc_64-no-pie-1.dd [new file with mode: 0644]
ld/testsuite/ld-s390/s390.exp