IBM zSystems: Fix offset relative to static TLS
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Tue, 10 Jan 2023 13:51:47 +0000 (14:51 +0100)
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Tue, 10 Jan 2023 13:51:47 +0000 (14:51 +0100)
commit38775ca9a73f0586ae096e596f0fd13d2d6dbdd4
treee71480deac4eccb72bfe1e173f233cb42d386a0a
parentddf8d80aef899b250949277c688476bb5f90f75d
IBM zSystems: Fix offset relative to static TLS

For local exec TLS relocations of the form foo@NTPOFF+x the addend was
ignored.

bfd/ChangeLog:

* elf32-s390.c (elf_s390_relocate_section): Honor addend for
R_390_TLS_LE32.
* elf64-s390.c (elf_s390_relocate_section): Honor addend for
R_390_TLS_LE64.

ld/ChangeLog:

* testsuite/ld-s390/reloctlsle-1.d: New test.
* testsuite/ld-s390/reloctlsle-1.s: New test.

(cherry picked from commit aefebe82dc89711384b85329daa48d04c1d3a45b)
bfd/elf32-s390.c
bfd/elf64-s390.c
ld/testsuite/ld-s390/reloctlsle-1.d [new file with mode: 0644]
ld/testsuite/ld-s390/reloctlsle-1.s [new file with mode: 0644]