aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2001-12-04 14:05:54 +0000
committerThiemo Seufer <ths@networkno.de>2001-12-04 14:05:54 +0000
commit7496292d882a21b67db64b9969107586d6970002 (patch)
treefff8b563c4c5c00cbc58a6f8480da2b312078c8e
parent34ba82a8bb9bcac71a71f32bc31b700d8e70b670 (diff)
downloadgdb-7496292d882a21b67db64b9969107586d6970002.zip
gdb-7496292d882a21b67db64b9969107586d6970002.tar.gz
gdb-7496292d882a21b67db64b9969107586d6970002.tar.bz2
* config/tc-mips.c (append_insn): Add jump address range overflow
check.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9783288..9e75358 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
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
for ELF only.
(show): Document -mabi option.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 92d99c8..40f98df 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -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)