+2000-05-14 Alan Modra <alan@linuxcare.com.au>
+
+ * config/tc-h8300.c (do_a_fix_imm): Don't rely on `short' being 16
+ bits. Instead explicitly mask and sign extend. Do the 8 bit mask
+ and sign extend without an if statement.
+ (build_bytes): Likewise.
+
+2000-05-14 Kazu Hirata <kazu@hxi.com>
+
+ * config/tc-h8300.c (do_a_fix_imm): Output a reloc for no
+ X_add_symbol L_32 case.
+
2000-05-14 David O'Brien <obrien@FreeBSD.org>
* config/te-freebsd.h: New file.
/* tc-h8300.c -- Assemble code for the Hitachi H8/300
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation.
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 2000
+ Free Software Foundation.
This file is part of GAS, the GNU Assembler.
bytes[1] = operand->exp.X_add_number >> 16;
bytes[2] = operand->exp.X_add_number >> 8;
bytes[3] = operand->exp.X_add_number >> 0;
+ if (relaxmode != 0)
+ {
+ idx = (relaxmode == 2) ? R_MOV24B1 : R_MOVL1;
+ fix_new_exp (frag_now, offset, 4, &operand->exp, 0, idx);
+ }
break;
}
idx = R_MOV16B1;
else
idx = R_RELWORD;
- operand->exp.X_add_number = (short)operand->exp.X_add_number;
+ operand->exp.X_add_number =
+ ((operand->exp.X_add_number & 0xffff) ^ 0x8000) - 0x8000;
break;
case L_8:
size = 1;
where = 0;
idx = R_RELBYTE;
- /* This used to use a cast to char, but that fails if char is an
- unsigned type. We can't use `signed char', as that isn't valid
- K&R C. */
- if (operand->exp.X_add_number & 0x80)
- operand->exp.X_add_number |= ((offsetT) -1 << 8);
- else
- operand->exp.X_add_number &= 0xff;
+ operand->exp.X_add_number =
+ ((operand->exp.X_add_number & 0xff) ^ 0x80) - 0x80;
}
fix_new_exp (frag_now,
}
operand[i].exp.X_add_number -= 1;
- /* This used to use a cast to char, but that fails if char is an
- unsigned type. We can't use `signed char', as that isn't valid
- K&R C. */
- if (operand[i].exp.X_add_number & 0x80)
- operand[i].exp.X_add_number |= ((offsetT) -1 << 8);
- else
- operand[i].exp.X_add_number &= 0xff;
+ operand[i].exp.X_add_number =
+ ((operand[i].exp.X_add_number & 0xff) ^ 0x80) - 0x80;
fix_new_exp (frag_now,
output - frag_now->fr_literal + where,
(unsigned long) operand->exp.X_add_number);
}
if (!Hmode)
- operand[i].exp.X_add_number = (short) operand[i].exp.X_add_number;
+ operand[i].exp.X_add_number =
+ ((operand[i].exp.X_add_number & 0xffff) ^ 0x8000) - 0x8000;
fix_new_exp (frag_now,
output - frag_now->fr_literal,
4,