mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-03 04:12:10 +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.
10 lines
214 B
Plaintext
10 lines
214 B
Plaintext
SECTIONS
|
|
{
|
|
x1 = 0x10000001; /* lower and far */
|
|
x2 = 0x3ffff000; /* lower and near */
|
|
. = 0x40000000;
|
|
.text : { *(.text) }
|
|
x3 = 0x4000f000; /* high and near */
|
|
x4 = 0x80000001; /* high and far */
|
|
}
|