diff options
author | Faraz Shahbazker <fshahbazker@wavecomp.com> | 2019-05-23 18:16:08 -0700 |
---|---|---|
committer | Faraz Shahbazker <fshahbazker@wavecomp.com> | 2019-05-28 10:49:16 -0700 |
commit | 1e129bbefadbf09ace0fc7fcb3cfcda13700e3b8 (patch) | |
tree | fb8da25dcc2cc23c404b557906b0215e62dee631 /bfd | |
parent | a2f4b66c9eb5210f8ef6038d7194af1e5f314f97 (diff) | |
download | gdb-1e129bbefadbf09ace0fc7fcb3cfcda13700e3b8.zip gdb-1e129bbefadbf09ace0fc7fcb3cfcda13700e3b8.tar.gz gdb-1e129bbefadbf09ace0fc7fcb3cfcda13700e3b8.tar.bz2 |
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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elfxx-mips.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 09ba27a..a6157a4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2019-05-28 Faraz Shahbazker <fshahbazker@wavecomp.com> + + * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>: + Remove overflow check. + 2019-05-28 Alan Modra <amodra@gmail.com> PR 24596 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index c64f90c..55f891d 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -6326,8 +6326,6 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, case R_MIPS_PCHI16: value = mips_elf_high (symbol + addend - p); - if (was_local_p || h->root.root.type != bfd_link_hash_undefweak) - overflowed_p = mips_elf_overflow_p (value, 16); value &= howto->dst_mask; break; |