]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
LoongArch: Fix relaxation overflow caused by ld -z separate-code
authormengqinggang <mengqinggang@loongson.cn>
Wed, 22 May 2024 06:27:08 +0000 (14:27 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Mon, 27 May 2024 09:41:04 +0000 (17:41 +0800)
commit6f779908fd6d7c85197ab13949a9dc5e6d4f1458
tree00725fade1e0d17330a79b2b5a8aa10cae0edb14
parent4250085217f2011335257fd3291cb50c939e9746
LoongArch: Fix relaxation overflow caused by ld -z separate-code

ld -z separate-code let .text and .rodata in two different but read only
segment. If the symbol and pc in two segment, the offset from pc to
symbol need to consider segment alignment.

Add a function 'loongarch_two_sections_in_same_segment' to determine
whether two sections are in the same segment.
bfd/elfnn-loongarch.c
ld/testsuite/ld-loongarch-elf/relax-medium-call-1.d
ld/testsuite/ld-loongarch-elf/relax-medium-call-1.s
ld/testsuite/ld-loongarch-elf/relax-medium-call.d
ld/testsuite/ld-loongarch-elf/relax-medium-call.s
ld/testsuite/ld-loongarch-elf/relax-separate-code-overflow.s [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/relax.exp