* config/tc-mips.c (append_insn): Add jump address range overflow
authorThiemo Seufer <ths@networkno.de>
Tue, 4 Dec 2001 14:05:54 +0000 (14:05 +0000)
committerThiemo Seufer <ths@networkno.de>
Tue, 4 Dec 2001 14:05:54 +0000 (14:05 +0000)
check.

gas/ChangeLog
gas/config/tc-mips.c

index 9783288120ad03653a70ded21e768ef8c2e1ea3d..9e753580cddfdf58371df468937cddb9e9c17d34 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * config/tc-mips.c (append_insn): Add jump address range overflow
+       check.
+
 2001-12-04  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * config/tc-mips.c (md_parse_option): Fix comment. Allow -mabi option
index 92d99c81eeb44d8bed8a755a1574fae12ab7b75d..40f98dfd216078be6a1d24f2b370743e8d93934d 100644 (file)
@@ -1974,6 +1974,10 @@ 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)
+               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;
              break;
 
@@ -1981,6 +1985,10 @@ 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)
+               as_bad (_("jump address range overflow (0x%lx)"),
+                       (unsigned long) address_expr->X_add_number);
              ip->insn_opcode |=
                (((address_expr->X_add_number & 0x7c0000) << 3)
                 | ((address_expr->X_add_number & 0xf800000) >> 7)