]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Fix the infinite loop caused by calling undefweak symbol
authorLulu Cai <cailulu@loongson.cn>
Tue, 3 Dec 2024 11:37:26 +0000 (19:37 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Tue, 3 Dec 2024 11:52:35 +0000 (19:52 +0800)
commiteb06e396416de9a609bf4adfdb9823ab2c8a395c
treeeda7701a014d1b0bfe240d1984d089ede19c2f3f
parent6da184277006a211c7b18a7ad3ae918d372d3da2
LoongArch: Fix the infinite loop caused by calling undefweak symbol

The undefweak symbol value of non-default visibility is 0 and does
not use plt entry, and will not be relocated in the relocate_secion
function. As a result, an infinite loop is generated because
bl %plt(sym) => bl 0.

Fix this by converting the call into a jump address 0.
bfd/elfnn-loongarch.c
ld/testsuite/ld-loongarch-elf/call_undefweak.d [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/call_undefweak.s [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp