binutils-gdb/ld/testsuite/ld-loongarch-elf/check_relax_got.ld
Lulu Cai 77bcfb741c LoongArch: Do not relax pcalau12i+ld.d when there is overflow
There is no overflow check for the relaxation of pcalau12i+ld.d =>
pcalau12i+addi.d. For instruction sequences that can be relaxed,
they are directly relaxed to pcalau12i+addi.d. However, when the
relative distance between the symbol and the pc exceeds the 32-bit
range, the symbol value cannot be obtained correctly.

Adds an overflow check for the relaxation of pcalau12i+ld.d.
If it is found that the relaxation will overflow, it will not
be relaxed.
2024-11-19 09:42:23 +08:00

26 lines
280 B
Plaintext

OUTPUT_ARCH(loongarch)
ENTRY(_start)
SECTIONS
{
PROVIDE (__executable_start = 0x8000);
. = 0x10000;
.text :
{
*(.text)
} =0
. = 0x2000000;
.got :
{
*(.got.plt) *(.got)
}
. = 0x82000000;
.other :
{
*(.other)
}
/DISCARD/ :
{
*(*)
}
}