From f3c0ec86c4c4a6784ea449e0e76a6a37f2da4488 Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Thu, 26 Sep 2002 09:00:08 +0000 Subject: [PATCH] * config/tc-mips.c (append_insn): Fix jump overflow check. * gas/mips/jal-range.s: Fix jump overflow check. * gas/mips/jal-range.l: Likewise. --- gas/ChangeLog | 4 ++++ gas/config/tc-mips.c | 6 ++---- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/mips/jal-range.l | 6 +++--- gas/testsuite/gas/mips/jal-range.s | 7 ++++--- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index eaef1392d35..eda63ad82fd 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2002-09-26 Thiemo Seufer + + * config/tc-mips.c (append_insn): Fix jump overflow check. + 2002-09-24 Alan Modra * config/tc-i386.c (process_operands): Warn about "lea" segment diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index ba803d21588..bd797c4bc4f 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1858,8 +1858,7 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi) if ((address_expr->X_add_number & 3) != 0) as_bad (_("jump to misaligned address (0x%lx)"), (unsigned long) address_expr->X_add_number); - if (address_expr->X_add_number & ~0xfffffff - || address_expr->X_add_number > 0x7fffffc) + if (address_expr->X_add_number & ~0xfffffff) as_bad (_("jump address range overflow (0x%lx)"), (unsigned long) address_expr->X_add_number); ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0x3ffffff; @@ -1869,8 +1868,7 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi) if ((address_expr->X_add_number & 3) != 0) as_bad (_("jump to misaligned address (0x%lx)"), (unsigned long) address_expr->X_add_number); - if (address_expr->X_add_number & ~0xfffffff - || address_expr->X_add_number > 0x7fffffc) + if (address_expr->X_add_number & ~0xfffffff) as_bad (_("jump address range overflow (0x%lx)"), (unsigned long) address_expr->X_add_number); ip->insn_opcode |= diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 9523d4858b6..159a61734f9 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-09-26 Thiemo Seufer + + * gas/mips/jal-range.s: Fix jump overflow check. + * gas/mips/jal-range.l: Likewise. + 2002-09-23 Nick Clifton * gas/arm/armv1-bad.s: Add LDM and STM instructions which are diff --git a/gas/testsuite/gas/mips/jal-range.l b/gas/testsuite/gas/mips/jal-range.l index 79a2509deeb..3887e1812c2 100644 --- a/gas/testsuite/gas/mips/jal-range.l +++ b/gas/testsuite/gas/mips/jal-range.l @@ -1,4 +1,4 @@ .*: Assembler messages: -.*:5: Error: jump to misaligned address \(0x7fffffd\) -.*:5: Error: jump address range overflow \(0x7fffffd\) -.*:6: Error: jump address range overflow \(0x8000000\) +.*:4: Error: jump to misaligned address \(0x1\) +.*:6: Error: jump to misaligned address \(0xfffffff\) +.*:7: Error: jump address range overflow \(0x10000000\) diff --git a/gas/testsuite/gas/mips/jal-range.s b/gas/testsuite/gas/mips/jal-range.s index 4d843b131a2..e52f56024ad 100644 --- a/gas/testsuite/gas/mips/jal-range.s +++ b/gas/testsuite/gas/mips/jal-range.s @@ -1,6 +1,7 @@ # Source file use to test border cases of jumps jal 0x0 - jal 0x7fffffc - jal 0x7fffffd - jal 0x8000000 + jal 0x1 + jal 0xffffffc + jal 0xfffffff + jal 0x10000000 -- 2.30.2