static enum mach_selection_type mach_selection_mode = MACH_SELECTION_NONE;
/* The hash table of instruction opcodes. */
-static struct hash_control *arc_opcode_hash;
+static htab_t arc_opcode_hash;
/* The hash table of register symbols. */
-static struct hash_control *arc_reg_hash;
+static htab_t arc_reg_hash;
/* The hash table of aux register symbols. */
-static struct hash_control *arc_aux_hash;
+static htab_t arc_aux_hash;
/* The hash table of address types. */
-static struct hash_control *arc_addrtype_hash;
+static htab_t arc_addrtype_hash;
#define ARC_CPU_TYPE_A6xx(NAME,EXTRA) \
{ #NAME, ARC_OPCODE_ARC600, bfd_mach_arc_arc600, \
{
const struct arc_opcode_hash_entry *entry;
- entry = hash_find (arc_opcode_hash, name);
+ entry = str_hash_find (arc_opcode_hash, name);
return entry;
}
static void
arc_insert_opcode (const struct arc_opcode *opcode)
{
- const char *name, *retval;
+ const char *name;
struct arc_opcode_hash_entry *entry;
name = opcode->name;
- entry = hash_find (arc_opcode_hash, name);
+ entry = str_hash_find (arc_opcode_hash, name);
if (entry == NULL)
{
entry = XNEW (struct arc_opcode_hash_entry);
entry->count = 0;
entry->opcode = NULL;
- retval = hash_insert (arc_opcode_hash, name, (void *) entry);
- if (retval)
- as_fatal (_("internal error: can't hash opcode '%s': %s"),
- name, retval);
+ str_hash_insert (arc_opcode_hash, name, (void *) entry);
}
entry->opcode = XRESIZEVEC (const struct arc_opcode *, entry->opcode,
tmpp = strdup (p);
for (pp = tmpp; *pp; ++pp) *pp = TOLOWER (*pp);
- auxr = hash_find (arc_aux_hash, tmpp);
+ auxr = str_hash_find (arc_aux_hash, tmpp);
if (auxr)
{
/* We modify the token array here, safe in the
static void
declare_register (const char *name, int number)
{
- const char *err;
symbolS *regS = symbol_create (name, reg_section,
number, &zero_address_frag);
- err = hash_insert (arc_reg_hash, S_GET_NAME (regS), (void *) regS);
- if (err)
- as_fatal (_("Inserting \"%s\" into register table failed: %s"),
- name, err);
+ str_hash_insert (arc_reg_hash, S_GET_NAME (regS), (void *) regS);
}
/* Construct symbols for each of the general registers. */
static void
declare_addrtype (const char *name, int number)
{
- const char *err;
symbolS *addrtypeS = symbol_create (name, undefined_section,
number, &zero_address_frag);
- err = hash_insert (arc_addrtype_hash, S_GET_NAME (addrtypeS),
- (void *) addrtypeS);
- if (err)
- as_fatal (_("Inserting \"%s\" into address type table failed: %s"),
- name, err);
+ str_hash_insert (arc_addrtype_hash, S_GET_NAME (addrtypeS),
+ (void *) addrtypeS);
}
/* Port-specific assembler initialization. This function is called
bfd_set_private_flags (stdoutput, selected_cpu.eflags);
/* Set up a hash table for the instructions. */
- arc_opcode_hash = hash_new ();
+ arc_opcode_hash = str_htab_create ();
if (arc_opcode_hash == NULL)
as_fatal (_("Virtual memory exhausted"));
}while (opcode->name);
/* Register declaration. */
- arc_reg_hash = hash_new ();
+ arc_reg_hash = str_htab_create ();
if (arc_reg_hash == NULL)
as_fatal (_("Virtual memory exhausted"));
memset (&arc_last_insns[0], 0, sizeof (arc_last_insns));
/* Aux register declaration. */
- arc_aux_hash = hash_new ();
+ arc_aux_hash = str_htab_create ();
if (arc_aux_hash == NULL)
as_fatal (_("Virtual memory exhausted"));
unsigned int i;
for (i = 0; i < arc_num_aux_regs; i++, auxr++)
{
- const char *retval;
-
if (!(auxr->cpu & selected_cpu.flags))
continue;
&& !check_cpu_feature (auxr->subclass))
continue;
- retval = hash_insert (arc_aux_hash, auxr->name, (void *) auxr);
- if (retval)
- as_fatal (_("internal error: can't hash aux register '%s': %s"),
- auxr->name, retval);
+ str_hash_insert (arc_aux_hash, auxr->name, (void *) auxr);
}
/* Address type declaration. */
- arc_addrtype_hash = hash_new ();
+ arc_addrtype_hash = str_htab_create ();
if (arc_addrtype_hash == NULL)
as_fatal (_("Virtual memory exhausted"));
&& e->X_md == O_absent)
return FALSE;
- sym = hash_find (arc_reg_hash, name);
+ sym = str_hash_find (arc_reg_hash, name);
if (sym)
{
e->X_op = O_register;
return TRUE;
}
- sym = hash_find (arc_addrtype_hash, name);
+ sym = str_hash_find (arc_addrtype_hash, name);
if (sym)
{
e->X_op = O_addrtype;
{
struct symbol *sym;
- sym = hash_find (arc_reg_hash, regname);
+ sym = str_hash_find (arc_reg_hash, regname);
if (sym)
return S_GET_VALUE (sym);
{
extRegister_t ereg;
struct arc_aux_reg *auxr;
- const char *retval;
struct arc_flag_operand *ccode;
memset (&ereg, 0, sizeof (ereg));
auxr->cpu = selected_cpu.flags;
auxr->subclass = NONE;
auxr->address = ereg.number;
- retval = hash_insert (arc_aux_hash, auxr->name, (void *) auxr);
- if (retval)
- as_fatal (_("internal error: can't hash aux register '%s': %s"),
- auxr->name, retval);
+ str_hash_insert (arc_aux_hash, auxr->name, (void *) auxr);
break;
case EXT_COND_CODE:
/* Condition code. */