/* tc-dlx.c -- Assemble for the DLX
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#include "safe-ctype.h"
#include "tc-dlx.h"
#include "opcode/dlx.h"
+#include "elf/dlx.h"
+#include "bfd/elf32-dlx.h"
/* Make it easier to clone this machine desc into another one. */
#define machine_opcode dlx_opcode
#define RELOC_DLX_VTENTRY BFD_RELOC_VTABLE_ENTRY
/* handle of the OPCODE hash table */
-static struct hash_control *op_hash = NULL;
+static htab_t op_hash = NULL;
struct machine_it
{
char buf[80];
int i;
- symbol_table_insert (symbol_new (regname, reg_section, (valueT) regnum,
- &zero_address_frag));
+ symbol_table_insert (symbol_new (regname, reg_section,
+ &zero_address_frag, regnum));
for (i = 0; regname[i]; i++)
buf[i] = ISLOWER (regname[i]) ? TOUPPER (regname[i]) : regname[i];
buf[i] = '\0';
- symbol_table_insert (symbol_new (buf, reg_section, (valueT) regnum,
- &zero_address_frag));
+ symbol_table_insert (symbol_new (buf, reg_section,
+ &zero_address_frag, regnum));
}
/* Install symbol definitions for assorted special registers.
void
md_begin (void)
{
- const char *retval = NULL;
- int lose = 0;
unsigned int i;
/* Create a new hash table. */
- op_hash = hash_new ();
+ op_hash = str_htab_create ();
/* Hash up all the opcodes for fast use later. */
for (i = 0; i < num_dlx_opcodes; i++)
{
const char *name = machine_opcodes[i].name;
-
- retval = hash_insert (op_hash, name, (void *) &machine_opcodes[i]);
-
- if (retval != NULL)
- {
- fprintf (stderr, _("internal error: can't hash `%s': %s\n"),
- machine_opcodes[i].name, retval);
- lose = 1;
- }
+ str_hash_insert (op_hash, name, (void *) &machine_opcodes[i]);
}
- if (lose)
- as_fatal (_("Broken assembler. No assembly attempted."));
-
define_some_regs ();
}
}
/* Hash the opcode, insn will have the string from opcode table. */
- if ((insn = (struct machine_opcode *) hash_find (op_hash, str)) == NULL)
+ if ((insn = (struct machine_opcode *) str_hash_find (op_hash, str)) == NULL)
{
/* Handle the ret and return macro here. */
if ((strcmp (str, "ret") == 0) || (strcmp (str, "return") == 0))
/* Macro move operand/reg. */
if (operand->X_op == O_register)
{
- /* Its a register. */
+ /* It's a register. */
reg_shift = 21;
goto general_reg;
}
+ /* Fall through. */
/* The immediate 16 bits literal, bit 0-15. */
case 'i':
free (fixP->fx_bit_fixP);
fixP->fx_bit_fixP = NULL;
}
-#ifdef DEBUG
- else
- know ((fixP->fx_bit_fixP != NULL));
-#endif
break;
case RELOC_DLX_HI16:
free (fixP->fx_bit_fixP);
fixP->fx_bit_fixP = NULL;
}
-#ifdef DEBUG
- else
- know ((fixP->fx_bit_fixP != NULL));
-#endif
break;
case RELOC_DLX_REL26:
free (fixP->fx_bit_fixP);
fixP->fx_bit_fixP = NULL;
}
-#ifdef DEBUG
- else
- know ((fixP->fx_bit_fixP != NULL));
-#endif
break;
case BFD_RELOC_VTABLE_INHERIT:
number_to_chars_bigendian (place, val, fixP->fx_size);
if (fixP->fx_addsy == NULL)
fixP->fx_done = 1;
+ if (fixP->fx_bit_fixP != NULL)
+ fixP->fx_no_overflow = 1;
}
const char *md_shortopts = "";