mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +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.
19 lines
576 B
Makefile
19 lines
576 B
Makefile
#name: MIPS r6 PC-relative hi+lo relocations
|
|
#ld: -Treloc-pcrel-r6.ld -e0
|
|
#as: -mips32r6
|
|
#objdump: -dr --prefix-addresses --show-raw-insn
|
|
#dump: reloc-pcrel-r6.d
|
|
|
|
.*: +file format .*mips.*
|
|
|
|
Disassembly of section \.text:
|
|
[0-9a-f]+ <test> ec9ed000 auipc a0,0xd000
|
|
[0-9a-f]+ <[^>]*> 24840001 addiu a0,a0,1
|
|
[0-9a-f]+ <[^>]*> ec9e0000 auipc a0,0x0
|
|
[0-9a-f]+ <[^>]*> 2484eff8 addiu a0,a0,-4104
|
|
[0-9a-f]+ <[^>]*> ec9e0001 auipc a0,0x1
|
|
[0-9a-f]+ <[^>]*> 2484eff0 addiu a0,a0,-4112
|
|
[0-9a-f]+ <[^>]*> ec9e4000 auipc a0,0x4000
|
|
[0-9a-f]+ <[^>]*> 2484ffe9 addiu a0,a0,-23
|
|
\.\.\.
|