MIPS/GAS: Correct BFD_RELOC_MIPS16_16_PCREL_S1 fixup size
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 25 Apr 2017 09:20:14 +0000 (10:20 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Tue, 25 Apr 2017 10:53:45 +0000 (11:53 +0100)
commitadc1273cb27286452ed8b32c5ca3ea263b4854f0
treed81c520fc1e7bac4c790d5c09cfd585c40021ee1
parentdebed3db4887483552103da36d180967ef0dca5f
MIPS/GAS: Correct BFD_RELOC_MIPS16_16_PCREL_S1 fixup size

Correct the size of a BFD_RELOC_MIPS16_16_PCREL_S1 fixup made in
`md_convert_frag', fixing a bug introduced with commit c9775dde3277
("MIPS16: Add R_MIPS16_PC16_S1 branch relocation support)".  Add test
cases to verify that the overflow of this fixup's in-place addend is
still correctly detected.

gas/
* config/tc-mips.c (md_convert_frag): Correct
BFD_RELOC_MIPS16_16_PCREL_S1 fixup size.
* testsuite/gas/mips/mips16-branch-addend-4.d: New test.
* testsuite/gas/mips/mips16-branch-addend-5.d: New test.
* testsuite/gas/mips/mips16-branch-addend-5.l: New stderr
output.
* testsuite/gas/mips/mips16-branch-addend-4.s: New test source.
* testsuite/gas/mips/mips16-branch-addend-5.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-branch-addend-4.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-addend-4.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-addend-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-addend-5.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-branch-addend-5.s [new file with mode: 0644]