aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-crx.c
diff options
context:
space:
mode:
authorTomer Levi <Tomer.Levi@nsc.com>2004-11-08 13:51:55 +0000
committerTomer Levi <Tomer.Levi@nsc.com>2004-11-08 13:51:55 +0000
commitaea44f629082dce28d0330e7eb496133426bdff6 (patch)
tree5629a55172930b17154772ca1f5abd103ce12b5b /gas/config/tc-crx.c
parent7499d566bb9495cac23109f01ded20f8849d08ae (diff)
downloadgdb-aea44f629082dce28d0330e7eb496133426bdff6.zip
gdb-aea44f629082dce28d0330e7eb496133426bdff6.tar.gz
gdb-aea44f629082dce28d0330e7eb496133426bdff6.tar.bz2
2004-11-08 Tomer Levi <Tomer.Levi@nsc.com>
* config/tc-crx.c (print_insn): Check and set insn_addr. * config/tc-crx.h (md_frag_check): Define.
Diffstat (limited to 'gas/config/tc-crx.c')
-rw-r--r--gas/config/tc-crx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
index e9b1538..8d1f95f 100644
--- a/gas/config/tc-crx.c
+++ b/gas/config/tc-crx.c
@@ -1229,7 +1229,7 @@ set_operand (char *operand, ins * crx_ins)
operandS++;
case arg_c: /* Case 0x18. */
/* Set constant. */
- process_label_constant (operandS, crx_ins/*, op_num*/);
+ process_label_constant (operandS, crx_ins);
if (cur_arg->type != arg_ic)
cur_arg->type = arg_c;
@@ -1242,7 +1242,7 @@ set_operand (char *operand, ins * crx_ins)
while (*operandE != '(')
operandE++;
*operandE = '\0';
- process_label_constant (operandS, crx_ins/*, op_num*/);
+ process_label_constant (operandS, crx_ins);
operandS = operandE;
case arg_rbase: /* Case (r1). */
operandS++;
@@ -2382,6 +2382,7 @@ print_insn (ins *insn)
unsigned int i, j, insn_size;
char *this_frag;
unsigned short words[4];
+ int addr_mod;
/* Arrange the insn encodings in a WORD size array. */
for (i = 0, j = 0; i < 2; i++)
@@ -2443,6 +2444,13 @@ print_insn (ins *insn)
}
}
+ /* Verify a 2-byte code alignment. */
+ addr_mod = frag_now_fix () & 1;
+ if (frag_now->has_code && frag_now->insn_addr != addr_mod)
+ as_bad (_("instruction address is not a multiple of 2"));
+ frag_now->insn_addr = addr_mod;
+ frag_now->has_code = 1;
+
/* Write the instruction encoding to frag. */
for (i = 0; i < insn_size; i++)
{