aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-01-30 13:13:29 +0000
committerAlan Modra <amodra@gmail.com>2001-01-30 13:13:29 +0000
commit22862cde861eb154c42dede997eaeda3abdc0e03 (patch)
tree5bc48392d6a2d4a51b6479cf9f13f6bd029934cd /gas
parent9540464302fbf77b83c628bb54165020d9375f6e (diff)
downloadbinutils-22862cde861eb154c42dede997eaeda3abdc0e03.zip
binutils-22862cde861eb154c42dede997eaeda3abdc0e03.tar.gz
binutils-22862cde861eb154c42dede997eaeda3abdc0e03.tar.bz2
Fix a null-pointer dereference and some range checks.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-hppa.c23
2 files changed, 15 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c3a423d..dc97038 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-30 Alan Modra <alan@linuxcare.com.au>
+
+ * config/tc-hppa.c (pa_ip): Support 12 bit branches to absolute
+ destinations. Correct range check for 17 and 22 bit branches.
+
2001-01-25 Nick Clifton <nickc@redhat.com>
* config/tc-m68k.c (tc_gen_reloc): Do not abort if tcbit is
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index f87b57a..568becd 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -3193,7 +3193,9 @@ pa_ip (str)
get_expression (s);
s = expr_end;
the_insn.pcrel = 1;
- if (!strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001"))
+ if (!the_insn.exp.X_add_symbol
+ || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
+ "L$0\001"))
{
num = evaluate_absolute (&the_insn);
if (num % 4)
@@ -3201,9 +3203,10 @@ pa_ip (str)
as_bad (_("Branch to unaligned address"));
break;
}
- CHECK_FIELD (num, 8199, -8184, 0);
-
- opcode |= re_assemble_12 ((num - 8) >> 2);
+ if (the_insn.exp.X_add_symbol)
+ num -= 8;
+ CHECK_FIELD (num, 8191, -8192, 0);
+ opcode |= re_assemble_12 (num >> 2);
continue;
}
else
@@ -3232,11 +3235,9 @@ pa_ip (str)
as_bad (_("Branch to unaligned address"));
break;
}
- CHECK_FIELD (num, 262143, -262144, 0);
-
if (the_insn.exp.X_add_symbol)
num -= 8;
-
+ CHECK_FIELD (num, 262143, -262144, 0);
opcode |= re_assemble_17 (num >> 2);
continue;
}
@@ -3265,11 +3266,9 @@ pa_ip (str)
as_bad (_("Branch to unaligned address"));
break;
}
- CHECK_FIELD (num, 8388607, -8388608, 0);
-
if (the_insn.exp.X_add_symbol)
num -= 8;
-
+ CHECK_FIELD (num, 8388607, -8388608, 0);
opcode |= re_assemble_22 (num >> 2);
}
else
@@ -3297,11 +3296,9 @@ pa_ip (str)
as_bad (_("Branch to unaligned address"));
break;
}
- CHECK_FIELD (num, 262143, -262144, 0);
-
if (the_insn.exp.X_add_symbol)
num -= 8;
-
+ CHECK_FIELD (num, 262143, -262144, 0);
opcode |= re_assemble_17 (num >> 2);
continue;
}