]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Fix relaxation overflow caused by section alignment
authormengqinggang <mengqinggang@loongson.cn>
Wed, 27 Dec 2023 03:12:30 +0000 (11:12 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Fri, 12 Jan 2024 07:38:42 +0000 (15:38 +0800)
commit156a2edbdbb94c197a992b218d482002aa727ce8
tree5827cbe0644028e05c7a4ba9a446dd0e11334868
parent192781a39861a841b61c39d2536b2ac622aa0d73
LoongArch: Fix relaxation overflow caused by section alignment

When deleting NOP instructions addend by .align at second pass, this may cause
the PC decrease but the symbol address to remain unchanged due to section
alignment.

To solve this question, we subtract a maximux alignment of all sections like
RISC-V.
bfd/elfnn-loongarch.c
ld/testsuite/ld-loongarch-elf/relax-section-align-overflow.s [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/relax.exp