aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1997-09-18 22:16:18 +0000
committerNick Clifton <nickc@redhat.com>1997-09-18 22:16:18 +0000
commit6df3c45f79c98a397e20edcdf68151d5888412b7 (patch)
tree2fc5b1e068cd3bc58765ff2d3334bd31986667f7
parent55e6f0bf327ea57ae19cd193cda3537712905651 (diff)
downloadgdb-6df3c45f79c98a397e20edcdf68151d5888412b7.zip
gdb-6df3c45f79c98a397e20edcdf68151d5888412b7.tar.gz
gdb-6df3c45f79c98a397e20edcdf68151d5888412b7.tar.bz2
Proced error messages when special data are relocations are used on
instructions which do not support them.
-rw-r--r--gas/ChangeLog2
-rw-r--r--gas/config/tc-v850.c40
2 files changed, 32 insertions, 10 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index e86c6e7..af553d1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -2,6 +2,8 @@ Thu Sep 18 14:11:56 1997 Nick Clifton <nickc@cygnus.com>
* config/tc-v850.c (md_assemble): Cope with a zero data area
relocation with a constant offset.
+ (md_assemble): Produce error message when special data area
+ relocations are used on instructions which do not support them.
Thu Sep 18 11:24:01 1997 Doug Evans <dje@canuck.cygnus.com>
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index 48ee16e..df14fe9 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1045,8 +1045,12 @@ handle_ctoff (const struct v850_operand * operand)
if (operand == NULL)
return BFD_RELOC_V850_CALLT_16_16_OFFSET;
- assert (operand->bits == 6);
- assert (operand->shift == 0);
+ if ( operand->bits != 6
+ || operand->shift == 0)
+ {
+ as_bad ("ctoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
return BFD_RELOC_V850_CALLT_6_7_OFFSET;
}
@@ -1061,8 +1065,12 @@ handle_sdaoff (const struct v850_operand * operand)
if (operand->bits == -1) return BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET;
/* end-sanitize-v850e */
- assert (operand->bits == 16);
- assert (operand->shift == 16);
+ if ( operand->bits != 16
+ || operand->shift == 16)
+ {
+ as_bad ("sdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
return BFD_RELOC_V850_SDA_16_16_OFFSET;
}
@@ -1075,9 +1083,13 @@ handle_zdaoff (const struct v850_operand * operand)
/* start-sanitize-v850e */
if (operand->bits == -1) return BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET;
/* end-sanitize-v850e */
-
- assert (operand->bits == 16);
- assert (operand->shift == 16);
+
+ if ( operand->bits != 16
+ || operand->shift != 16)
+ {
+ as_bad ("zdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
return BFD_RELOC_V850_ZDA_16_16_OFFSET;
}
@@ -1093,7 +1105,11 @@ handle_tdaoff (const struct v850_operand * operand)
/* end-sanitize-v850e */
if (operand->bits == 16 && operand->shift == 16) return BFD_RELOC_V850_TDA_16_16_OFFSET; /* set1 & chums, operands: D16 */
- assert (operand->bits == 7);
+ if (operand->bits != 7)
+ {
+ as_bad ("tdaoff() relocation used on an instruction which does not support it");
+ return BFD_RELOC_64; /* Used to indicate an error condition. */
+ }
return operand->insert != NULL
? BFD_RELOC_V850_TDA_7_8_OFFSET /* sld.h/sst.h, operand: D8_7 */
@@ -1237,11 +1253,15 @@ md_assemble (str)
hold = input_line_pointer;
input_line_pointer = str;
-/* fprintf (stderr, "operand: %s index = %d, opcode = %s\n", input_line_pointer, opindex_ptr - opcode->operands, opcode->name ); */
-
/* lo(), hi(), hi0(), etc... */
if ((reloc = v850_reloc_prefix (operand)) != BFD_RELOC_UNUSED)
{
+ if (reloc == BFD_RELOC_64) /* This is a fake reloc, used to indicate an error condition. */
+ {
+ match = 1;
+ goto error;
+ }
+
expression (& ex);
if (ex.X_op == O_constant)