static const attributes_t syntaxclass[] =
{
{ "SYNTAX_3OP", 10, ARC_SYNTAX_3OP },
- { "SYNTAX_2OP", 10, ARC_SYNTAX_2OP }
+ { "SYNTAX_2OP", 10, ARC_SYNTAX_2OP },
+ { "SYNTAX_1OP", 10, ARC_SYNTAX_1OP },
+ { "SYNTAX_NOP", 10, ARC_SYNTAX_NOP }
};
/* Extension instruction syntax classes modifiers. */
entry = hash_find (arc_opcode_hash, name);
if (entry == NULL)
{
- entry = xmalloc (sizeof (*entry));
+ entry = XNEW (struct arc_opcode_hash_entry);
entry->count = 0;
entry->opcode = NULL;
name, retval);
}
- entry->opcode = xrealloc (entry->opcode,
- sizeof (const struct arc_opcode *)
- * (entry->count + 1));
+ entry->opcode = XRESIZEVEC (const struct arc_opcode *, entry->opcode,
+ entry->count + 1);
if (entry->opcode == NULL)
as_fatal (_("Virtual memory exhausted"));
/* Split off the opcode. */
opnamelen = strspn (str, "abcdefghijklmnopqrstuvwxyz_0123468");
- opname = xmalloc (opnamelen + 1);
- memcpy (opname, str, opnamelen);
- opname[opnamelen] = '\0';
+ opname = xmemdup0 (str, opnamelen);
/* Signalize we are assmbling the instructions. */
assembling_insn = TRUE;
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = (arelent *) xmalloc (sizeof (* reloc));
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ reloc = XNEW (arelent);
+ reloc->sym_ptr_ptr = XNEW (asymbol *);
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
&& (einsn.major != 5) && (einsn.major != 9))
as_fatal (_("minor opcode not in range [0x00 - 0x3f]"));
- switch (einsn.syntax & (ARC_SYNTAX_3OP | ARC_SYNTAX_2OP))
+ switch (einsn.syntax & ARC_SYNTAX_MASK)
{
case ARC_SYNTAX_3OP:
if (einsn.modsyn & ARC_OP1_IMM_IMPLIED)
as_fatal (_("Improper use of OP1_IMM_IMPLIED"));
break;
case ARC_SYNTAX_2OP:
+ case ARC_SYNTAX_1OP:
+ case ARC_SYNTAX_NOP:
if (einsn.modsyn & ARC_OP1_MUST_BE_IMM)
as_fatal (_("Improper use of OP1_MUST_BE_IMM"));
break;
break;
case EXT_AUX_REGISTER:
/* Auxiliary register. */
- auxr = xmalloc (sizeof (struct arc_aux_reg));
+ auxr = XNEW (struct arc_aux_reg);
auxr->name = ereg.name;
auxr->cpu = arc_target;
auxr->subclass = NONE;
ereg.number);
ext_condcode.size ++;
ext_condcode.arc_ext_condcode =
- xrealloc (ext_condcode.arc_ext_condcode,
- (ext_condcode.size + 1) * sizeof (struct arc_flag_operand));
+ XRESIZEVEC (struct arc_flag_operand, ext_condcode.arc_ext_condcode,
+ ext_condcode.size + 1);
if (ext_condcode.arc_ext_condcode == NULL)
as_fatal (_("Virtual memory exhausted"));