MIPS/LD: Skip overflow check for %pcrel_hi relocations
authorFaraz Shahbazker <fshahbazker@wavecomp.com>
Fri, 24 May 2019 01:16:08 +0000 (18:16 -0700)
committerFaraz Shahbazker <fshahbazker@wavecomp.com>
Tue, 28 May 2019 17:49:16 +0000 (10:49 -0700)
commit1e129bbefadbf09ace0fc7fcb3cfcda13700e3b8
treefb8da25dcc2cc23c404b557906b0215e62dee631
parenta2f4b66c9eb5210f8ef6038d7194af1e5f314f97
MIPS/LD: Skip overflow check for %pcrel_hi relocations

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.
bfd/ChangeLog
bfd/elfxx-mips.c
ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/reloc-pcrel-r6.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/reloc-pcrel-r6.ld [new file with mode: 0644]
ld/testsuite/ld-mips-elf/reloc-pcrel-r6.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/undefweak-overflow.d
ld/testsuite/ld-mips-elf/undefweak-overflow.s