mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
1e129bbefa
Overflow checks were removed for all hi16 relocations except PC-relative high relocations per PR ld/16720. Remove overflow checks from %pcrel_hi relocations so that we can correctly handle negative offsets from PC. bfd/ * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>: Remove overflow check. ld/ * testsuite/ld-mips-elf/undefweak-overflow.s: Remove test case for pcrel_hi/pcrel_lo. * testsuite/ld-mips-elf/undefweak-overflow.d: Update to match. * testsuite/ld-mips-elf/reloc-pcrel-r6.s: New test source. * testsuite/ld-mips-elf/reloc-pcrel-r6.d: New test linker script. * testsuite/ld-mips-elf/reloc-pcrel-r6.ld: New test. * testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
28 lines
388 B
ArmAsm
28 lines
388 B
ArmAsm
.text
|
|
.globl test
|
|
.globl x1
|
|
.globl x2
|
|
.globl x3
|
|
.globl x4
|
|
.ent test
|
|
test:
|
|
1:
|
|
auipc $a0,%pcrel_hi(x1)
|
|
2:
|
|
addiu $a0,$a0,%pcrel_lo(x1+(2b-1b))
|
|
1:
|
|
auipc $a0,%pcrel_hi(x2)
|
|
2:
|
|
addiu $a0,$a0, %pcrel_lo(x2+(2b-1b))
|
|
1:
|
|
auipc $a0,%pcrel_hi(x3)
|
|
2:
|
|
addiu $a0,$a0,%pcrel_lo(x3+(2b-1b))
|
|
1:
|
|
auipc $a0,%pcrel_hi(x4)
|
|
2:
|
|
addiu $a0,$a0,%pcrel_lo(x4+(2b-1b))
|
|
.end test
|
|
.align 2, 0
|
|
.space 8
|