/* tc-mcore.c -- Assemble code for M*Core
- Copyright (C) 1999-2015 Free Software Foundation, Inc.
+ Copyright (C) 1999-2016 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#define POOL_START_LABEL ".LS"
static void
-make_name (char * s, char * p, int n)
+make_name (char * s, const char * p, int n)
{
static const char hex[] = "0123456789ABCDEF";
void
md_begin (void)
{
- const mcore_opcode_info * opcode;
- char * prev_name = "";
+ const char * prev_name = "";
+ unsigned int i;
opcode_hash_control = hash_new ();
/* Insert unique names into hash table. */
- for (opcode = mcore_table; opcode->name; opcode ++)
+ for (i = 0; i < ARRAY_SIZE (mcore_table); i++)
{
- if (! streq (prev_name, opcode->name))
+ if (! streq (prev_name, mcore_table[i].name))
{
- prev_name = opcode->name;
- hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
+ prev_name = mcore_table[i].name;
+ hash_insert (opcode_hash_control, mcore_table[i].name, (char *) &mcore_table[i]);
}
}
}
static struct Cregs
{
- char * name;
+ const char * name;
unsigned int crnum;
}
cregs[] =
char buf[10];
static struct psrmods
{
- char * name;
+ const char * name;
unsigned int value;
}
psrmods[] =
as_bad (_("M340 specific opcode used when assembling for M210"));
break;
}
- /* drop through... */
+ /* Fall through. */
case O2:
op_end = parse_reg (op_end + 1, & reg);
inst |= reg;
output[0] = INST_BYTE0 (inst);
output[1] = INST_BYTE1 (inst);
+#ifdef OBJ_ELF
+ dwarf2_emit_insn (2);
+#endif
check_literals (opcode->transfer, isize);
}
/* Various routines to kill one day. */
-char *
+const char *
md_atof (int type, char * litP, int * sizeP)
{
return ieee_md_atof (type, litP, sizeP, target_big_endian);
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
{
switch (c)
{
.align 2
0: .long disp
1:
-
+
If the b!cond is 4 byte aligned, the literal which would
go at x+4 will also be aligned. */
int first_inst = fragP->fr_fix + fragP->fr_address;
segT segment ATTRIBUTE_UNUSED)
{
char * buf = fixP->fx_where + fixP->fx_frag->fr_literal;
- char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
+ const char * file = fixP->fx_file ? fixP->fx_file : _("unknown");
const char * symname;
/* Note: use offsetT because it is signed, valueT is unsigned. */
offsetT val = *valP;
break;
}
- rel = xmalloc (sizeof (arelent));
- rel->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ rel = XNEW (arelent);
+ rel->sym_ptr_ptr = XNEW (asymbol *);
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
/* Always pass the addend along! */