aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Groessler <chris@groessler.org>2005-01-27 21:08:14 +0000
committerChristian Groessler <chris@groessler.org>2005-01-27 21:08:14 +0000
commitf87a1e0cb2925e98ae558efa7e59926627c50642 (patch)
treef4a18faab5eb9f3c711109c1bfc30ed83aa6f36c
parent79dd2d2463b44e50d224eb94edd40942dc467611 (diff)
downloadgdb-f87a1e0cb2925e98ae558efa7e59926627c50642.zip
gdb-f87a1e0cb2925e98ae558efa7e59926627c50642.tar.gz
gdb-f87a1e0cb2925e98ae558efa7e59926627c50642.tar.bz2
* config/tc-z8k.c (INSERT): Remove, not used anywhere.
(md_apply_fix3): Make relative branches out of range an error instead of a warning. Display correct line number for out of range branches/calls/memory accesses.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-z8k.c37
2 files changed, 28 insertions, 16 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f635784..1d19938 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-27 Christian Groessler <chris@groessler.org>
+
+ * config/tc-z8k.c (INSERT): Remove, not used anywhere.
+ (md_apply_fix3): Make relative branches out of range an error
+ instead of a warning. Display correct line number for out of
+ range branches/calls/memory accesses.
+
2005-01-27 Nathan Sidwell <nathan@codesourcery.com>
* dwarf2dbg.c (dwarf2_finish): Correct logic for determining when
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index f2aa9ad..06ffdae 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -1,6 +1,6 @@
/* tc-z8k.c -- Assemble code for the Zilog Z800n
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
+ 2005 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -995,8 +995,6 @@ apply_fix (char *ptr, int type, expressionS *operand, int size)
/* Now we know what sort of opcodes it is. Let's build the bytes. */
-#define INSERT(x,y) *x++ = y>>24; *x++ = y>> 16; *x++=y>>8; *x++ =y;
-
static void
build_bytes (opcode_entry_type *this_try, struct z8k_op *operand ATTRIBUTE_UNUSED)
{
@@ -1432,13 +1430,15 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
}
else
{
- if (val & 1)
- as_bad (_("cannot branch to odd address"));
- val /= 2;
- if (val > 127 || val < -128)
- as_warn (_("relative jump out of range"));
- *buf++ = val;
- fixP->fx_no_overflow = 1;
+ if (val & 1)
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("cannot branch to odd address"));
+ val /= 2;
+ if (val > 127 || val < -128)
+ as_warn_where (fixP->fx_file, fixP->fx_line,
+ _("relative jump out of range"));
+ *buf++ = val;
+ fixP->fx_no_overflow = 1;
fixP->fx_done = 1;
}
break;
@@ -1452,10 +1452,12 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
else
{
if (val & 1)
- as_bad (_("cannot branch to odd address"));
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("cannot branch to odd address"));
val /= 2;
if (val > 0 || val < -127)
- as_bad (_("relative jump out of range"));
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("relative jump out of range"));
*buf = (*buf & 0x80) | (-val & 0x7f);
fixP->fx_no_overflow = 1;
fixP->fx_done = 1;
@@ -1471,9 +1473,11 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
else
{
if (val & 1)
- as_bad (_("cannot branch to odd address"));
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("cannot branch to odd address"));
if (val > 4096 || val < -4095)
- as_bad (_("relative call out of range"));
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("relative call out of range"));
val = -val / 2;
*buf = (*buf & 0xf0) | ((val >> 8) & 0xf);
buf++;
@@ -1502,7 +1506,8 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT segment ATTRIBUTE_UNUSED)
case R_REL16:
val = val - fixP->fx_frag->fr_address + fixP->fx_where - fixP->fx_size;
if (val > 32767 || val < -32768)
- as_bad (_("relative address out of range"));
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("relative address out of range"));
*buf++ = (val >> 8);
*buf++ = val;
fixP->fx_no_overflow = 1;