{ "v", 0x0 },
{ "z", 0x2 },
};
-#define CC_NAME_CNT (sizeof(cc_names) / sizeof(struct reg_name))
+#define CC_NAME_CNT (sizeof (cc_names) / sizeof (struct reg_name))
/* reg_name_search does a binary search of the given register table
to see if "name" is a valid regiter name. Returns the register
/* Warning: The code in this function relies upon the definitions
in the v850_operands[] array (defined in opcodes/v850-opc.c)
- matching the hard coded values conatined herein. */
+ matching the hard coded values contained herein. */
static bfd_reloc_code_real_type
v850_reloc_prefix (const struct v850_operand * operand)
input_line_pointer += 2;
return BFD_RELOC_LO16;
}
+/* start-sanitize-v850e */
+ if (strncmp (input_line_pointer, "hilo(", 5) == 0)
+ {
+ input_line_pointer += 4;
+ return BFD_RELOC_32;
+ }
+/* end-sanitize-v850e */
if (strncmp (input_line_pointer, "sdaoff(", 7) == 0)
{
ex.X_add_number = SEXT16 (temp);
break;
}
-
+
+/* start-sanitize-v850e */
+ case BFD_RELOC_32:
+ if ((operand->flags & V850E_IMMEDIATE32) == 0)
+ {
+ errmsg = "use bigger instruction";
+ goto error;
+ }
+
+ extra_data_after_insn = true;
+ extra_data_len = 4;
+ extra_data = ex.X_add_number;
+ ex.X_add_number = 0;
+ break;
+/* end-sanitize-v850e */
+
default:
as_bad ( "AAARG -> unhandled constant reloc");
break;
}
else
{
+ if (reloc == BFD_RELOC_32)
+ {
+ if ((operand->flags & V850E_IMMEDIATE32) == 0)
+ {
+ errmsg = "use bigger instruction";
+ goto error;
+ }
+
+ extra_data_after_insn = true;
+ extra_data_len = 4;
+ extra_data = ex.X_add_number;
+ ex.X_add_number = 0;
+ }
+
if (fc > MAX_INSN_FIXUPS)
as_fatal ("too many fixups");
errmsg = "invalid condition code name";
}
}
- /* start-sanitize-v850e */
+/* start-sanitize-v850e */
else if (operand->flags & V850E_PUSH_POP)
{
errmsg = parse_register_list (& insn, operand);
ex.X_op = O_constant;
ex.X_add_number = 0;
}
- /* end-sanitize-v850e */
- /* start-sanitize-v850e */
else if (operand->flags & V850E_IMMEDIATE16)
{
expression (& ex);
extra_data = ex.X_add_number;
ex.X_add_number = 0;
}
- /* end-sanitize-v850e */
- /* start-sanitize-v850e */
else if (operand->flags & V850E_IMMEDIATE32)
{
expression (& ex);
extra_data = ex.X_add_number;
ex.X_add_number = 0;
}
- /* end-sanitize-v850e */
+/* end-sanitize-v850e */
else if (register_name (&ex)
&& (operand->flags & V850_OPERAND_REG) == 0)
{
if (extra_data_after_insn)
{
- char * g = frag_more (extra_data_len);
+ f = frag_more (extra_data_len);
- md_number_to_chars (g, extra_data, extra_data_len);
+ md_number_to_chars (f, extra_data, extra_data_len);
extra_data_after_insn = false;
}
for (i = 0; i < fc; i++)
{
const struct v850_operand * operand;
-
+ bfd_reloc_code_real_type reloc;
+
operand = & v850_operands[ fixups[i].opindex ];
+
+ reloc = fixups[i].reloc;
- if (fixups[i].reloc != BFD_RELOC_UNUSED)
+ if (reloc != BFD_RELOC_UNUSED)
{
- reloc_howto_type * reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc);
+ reloc_howto_type * reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc);
int size;
int address;
fixS * fixP;
abort();
address = (f - frag_now->fr_literal) + insn_size - size;
-
+
+ if (reloc == BFD_RELOC_32)
+ {
+ address += 2;
+ }
+
fixP = fix_new_exp (frag_now, address, size,
& fixups[i].exp,
reloc_howto->pc_relative,
- fixups[i].reloc);
+ reloc);
- switch (fixups[i].reloc)
+ switch (reloc)
{
case BFD_RELOC_LO16:
case BFD_RELOC_HI16:
reloc->sym_ptr_ptr = & fixp->fx_addsy->bsym;
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
-
+
if (reloc->howto == (reloc_howto_type *) NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
"reloc %d not supported by object file format", (int)fixp->fx_r_type);
+
+ xfree (reloc);
+
return NULL;
}
return 2;
}
-
long
md_pcrel_from (fixp)
fixS * fixp;
{
int opindex;
const struct v850_operand * operand;
- char * where;
unsigned long insn;
opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
fixp->fx_r_type = BFD_RELOC_V850_9_PCREL;
else
{
+ /* fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn); */
+
as_bad_where(fixp->fx_file, fixp->fx_line,
"unresolved expression that must be resolved");
fixp->fx_done = 1;
where = fixp->fx_frag->fr_literal + fixp->fx_where;
if (fixp->fx_size == 1)
*where = value & 0xff;
- if (fixp->fx_size == 2)
+ else if (fixp->fx_size == 2)
bfd_putl16 (value & 0xffff, (unsigned char *) where);
- if (fixp->fx_size == 4)
+ else if (fixp->fx_size == 4)
bfd_putl32 (value, (unsigned char *) where);
}