MIPS/BFD: Include the addend in JALX's target alignment verification
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 27 May 2016 19:43:05 +0000 (20:43 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Fri, 27 May 2016 21:31:29 +0000 (22:31 +0100)
commitbc27bb0573a5e1ce1a6365fc06aeab9bd891fc3a
treed45ba6d41359e4ec8d91194d036213be825330cd
parentceab86af75e9870ecf2da772a0d867ca12521a24
MIPS/BFD: Include the addend in JALX's target alignment verification

On RELA targets the addend can affect JALX target's alignment, so only
verify it once the whole relocation calculation has completed.

bfd/
* elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS16_26>
<R_MIPS_26, R_MICROMIPS_26_S1>: Include the addend in JALX's
target alignment verification.

ld/
* testsuite/ld-mips-elf/unaligned-jalx-addend-0.d: New test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d: New test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d: New
test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d: New
test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d: New
test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d: New
test.
* testsuite/ld-mips-elf/unaligned-jalx-addend-0.s: New test
source.
* testsuite/ld-mips-elf/unaligned-jalx-addend-1.s: New test
source.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
12 files changed:
bfd/ChangeLog
bfd/elfxx-mips.c
ld/ChangeLog
ld/testsuite/ld-mips-elf/mips-elf.exp
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-0.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-1.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-0.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-0.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d [new file with mode: 0644]