+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.
+
2004-11-08 Inderpreet Singh <inderpreetb@nioda.hcltech.com>
Vineet Sharma <vineets@noida.hcltech.com>
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;
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++;
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++)
}
}
+ /* 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++)
{
: LEN == 4 ? BFD_RELOC_CRX_NUM32 \
: BFD_RELOC_NONE);
+/* Give an error if a frag containing code is not aligned to a 2-byte
+ boundary. */
+#define md_frag_check(FRAGP) \
+ if ((FRAGP)->has_code \
+ && (((FRAGP)->fr_address + (FRAGP)->insn_addr) & 1) != 0) \
+ as_bad_where ((FRAGP)->fr_file, (FRAGP)->fr_line, \
+ _("instruction address is not a multiple of 2"));
+
#endif /* TC_CRX_H */