diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2017-04-25 10:20:14 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2017-04-25 11:53:45 +0100 |
commit | adc1273cb27286452ed8b32c5ca3ea263b4854f0 (patch) | |
tree | d81c520fc1e7bac4c790d5c09cfd585c40021ee1 /gas/config | |
parent | debed3db4887483552103da36d180967ef0dca5f (diff) | |
download | gdb-adc1273cb27286452ed8b32c5ca3ea263b4854f0.zip gdb-adc1273cb27286452ed8b32c5ca3ea263b4854f0.tar.gz gdb-adc1273cb27286452ed8b32c5ca3ea263b4854f0.tar.bz2 |
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.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 6a98122..da8e9ab 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -18445,15 +18445,11 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec, fragS *fragp) exp.X_add_symbol = fragp->fr_symbol; exp.X_add_number = fragp->fr_offset; - fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 2, &exp, + fixp = fix_new_exp (fragp, buf - fragp->fr_literal, 4, &exp, TRUE, reloc); fixp->fx_file = fragp->fr_file; fixp->fx_line = fragp->fr_line; - - /* These relocations can have an addend that won't fit - in 2 octets. */ - fixp->fx_no_overflow = 1; } else as_bad_where (fragp->fr_file, fragp->fr_line, |