]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Fix broken DESC => IE transition for 2.43 branch
authorXi Ruoyao <xry111@xry111.site>
Fri, 27 Dec 2024 08:26:28 +0000 (16:26 +0800)
committercailulu <cailulu@loongson.cn>
Sat, 28 Dec 2024 08:28:27 +0000 (16:28 +0800)
commita8563dba75c92e04dbc63bdbee03b0ebc8889fa8
treecd9b58ef8f2c35d3c71fa99d20b2ca2c0acce5d9
parente2d776f7b9c2ba59bdf2d885d0f9d6bb2c1d5d81
LoongArch: Fix broken DESC => IE transition for 2.43 branch

If code compiled with -fPIC -mtls-dialect=desc is linked into a PDE or
PIE, and the code refers to external DSO symbols, we can produce broken
link unit as check_relocs expects DESC => IE transition to happen and
emits a TLS IE entry in the GOT, but a too early "continue" in
relax_section actually jumps over the DESC => IE transition so the code
sequence is unchanged and still expecting a TLS descriptor (instead of
an IE entry) in the GOT.

The bug is already fixed in master branch by commit 5c3d09c1855b
("LoongArch: Optimize the relaxation process") so this fix is only
needed for the 2.43 branch.

Reported-by: Icenowy Zheng <uwu@icenowy.me>
Closes: https://gcc.gnu.org/PR118114
Tested-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
bfd/elfnn-loongarch.c