[MIPS] When calculating a relocation using an undefined weak symbol don't check for...
authorAndrew Bennett <andrew.bennett@imgtec.com>
Thu, 20 Nov 2014 15:40:16 +0000 (15:40 +0000)
committerMatthew Fortune <matthew.fortune@imgtec.com>
Fri, 19 Dec 2014 14:43:21 +0000 (14:43 +0000)
commitcfd4e875aeacf565f945c2818dbfff47807b6199
tree7f6e92f87598a11245c3170eb9e2351a0cf88cef
parent80bfea8ac449dbce1636ff07dd8095bf00780ad4
[MIPS] When calculating a relocation using an undefined weak symbol don't check for overflow.

In MIPS the relocation calculation only ignores the overflow checks for undefined
weak symbols on relocations associated with j/jal.   This patch extends this to
the relocations used by the: b* instructions; pc/gp relative symbol offsets; and the
lwpc/ldpc MIPS r6 instructions.

bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Only check for overflow
on non-weak undefined symbols.

ld/testsuite/
* ld-mips-elf/mips-elf.exp: Add in undefined weak overflow tests for
o32, n32 and n64.
* ld-mips-elf/undefweak-overflow.s: New test.
* ld-mips-elf/undefweak-overflow.d: New test.
* ld-mips-elf/undefweak-overflow-n32.d: New test.
* ld-mips-elf/undefweak-overflow-n64.d: New test.
bfd/ChangeLog
bfd/elfxx-mips.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/undefweak-overflow-n32.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/undefweak-overflow-n64.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/undefweak-overflow.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/undefweak-overflow.s [new file with mode: 0644]