binutils-gdb/ld/testsuite/ld-loongarch-elf/underflow_s_5_20.d
Jinyang He b98da8583a LoongArch: ld: Fix other pop relocs overflow check and add tests
Add reloc_unsign_bits() to fix others sop_pop relocs overflow check.
Then add over/underflow tests for relocs B*, SOP_POP* and PCREL20_S2.

bfd/ChangeLog:

	* bfd/elfxx-loongarch.c: Add reloc_unsign_bits().

ld/ChangeLog:

	* ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp: Add tests.
	* ld/testsuite/ld-loongarch-elf/abi1_max_imm.dd: New test.
	* ld/testsuite/ld-loongarch-elf/abi1_max_imm.s: New test.
	* ld/testsuite/ld-loongarch-elf/abi1_sops.s: New test.
	* ld/testsuite/ld-loongarch-elf/abi2_max_imm.s: New test.
	* ld/testsuite/ld-loongarch-elf/abi2_overflows.s: New test.
	* ld/testsuite/ld-loongarch-elf/max_imm_b16.d: New test.
	* ld/testsuite/ld-loongarch-elf/max_imm_b21.d: New test.
	* ld/testsuite/ld-loongarch-elf/max_imm_b26.d: New test.
	* ld/testsuite/ld-loongarch-elf/max_imm_pcrel20.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_b16.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_b21.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_b26.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_pcrel20.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_0_10_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_0_5_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_10_12.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_10_16.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_10_5.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_s_5_20.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_u.d: New test.
	* ld/testsuite/ld-loongarch-elf/overflow_u_10_12.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_b16.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_b21.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_b26.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_pcrel20.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_0_10_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_0_5_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_10_12.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_10_16.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_10_16_s2.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_10_5.d: New test.
	* ld/testsuite/ld-loongarch-elf/underflow_s_5_20.d: New test.
2024-02-27 11:54:34 +08:00

4 lines
160 B
Makefile

#source: abi1_sops.s
#as: --defsym underflow=1 --defsym s_5_20=1
#ld: -e 0
#error: .*relocation truncated to fit: R_LARCH_SOP_POP_32_S_5_20 against `<nameless>'