]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
MIPS: Fix linker for REL TLS HI16/LO16 relocs
authorAlan Modra <amodra@gmail.com>
Sat, 12 Jul 2025 00:25:53 +0000 (01:25 +0100)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 12 Jul 2025 00:25:53 +0000 (01:25 +0100)
commit7ea90d9316d375924b342485eb0cf99d268bf62f
tree0e222823851fba00533fb0fb1a91b4c790afce7c
parent78f28b69ff1cdd8fcdf1944cfd82ea45f23e94d2
MIPS: Fix linker for REL TLS HI16/LO16 relocs

With REL targets TLS HI16/LO16 relocations need to combine the low part
with the high part just as all the remaining HI16/LO16 relocations, so
as to determine the borrow in calculation correctly.

2025-07-12  Alan Modra  <amodra@gmail.com>

bfd/
PR 19977
* elfxx-mips.c (tls_hi16_reloc_p): New function.
(mips_elf_add_lo16_rel_addend): Handle tls relocs.
(_bfd_mips_elf_relocate_section): Likewise.

2025-07-12  Maciej W. Rozycki  <macro@orcam.me.uk>

ld/
PR 19977
* testsuite/ld-mips-elf/pr19977.d: New test.
* testsuite/ld-mips-elf/pr19977-mips16.d: New test.
* testsuite/ld-mips-elf/pr19977-micromips.d: New test.
* testsuite/ld-mips-elf/pr19977-r.d: New test.
* testsuite/ld-mips-elf/pr19977-r-mips16.d: New test.
* testsuite/ld-mips-elf/pr19977-r-micromips.d: New test.
* testsuite/ld-mips-elf/pr19977-r.s: New test source.
* testsuite/ld-mips-elf/pr19977.ld: New test linker script.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
bfd/elfxx-mips.c
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/pr19977-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977-mips16.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977-r-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977-r-mips16.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977-r.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977-r.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/pr19977.ld [new file with mode: 0644]