projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use bool in gas
[binutils-gdb.git]
/
gas
/
config
/
tc-moxie.c
diff --git
a/gas/config/tc-moxie.c
b/gas/config/tc-moxie.c
index ae17bb338246abd2559ef3b4b936c826b027e7db..22a29a0b74d0d1fdb12623e73826e5d554eb7a8c 100644
(file)
--- a/
gas/config/tc-moxie.c
+++ b/
gas/config/tc-moxie.c
@@
-1,5
+1,5
@@
/* tc-moxie.c -- Assemble code for moxie
/* tc-moxie.c -- Assemble code for moxie
- Copyright (C) 2009-20
16
Free Software Foundation, Inc.
+ Copyright (C) 2009-20
21
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
This file is part of GAS, the GNU Assembler.
@@
-32,7
+32,7
@@
const char line_separator_chars[] = ";";
const char line_comment_chars[] = "#";
static int pending_reloc;
const char line_comment_chars[] = "#";
static int pending_reloc;
-static
struct hash_control *
opcode_hash_control;
+static
htab_t
opcode_hash_control;
const pseudo_typeS md_pseudo_table[] =
{
const pseudo_typeS md_pseudo_table[] =
{
@@
-62,19
+62,17
@@
md_begin (void)
{
int count;
const moxie_opc_info_t *opcode;
{
int count;
const moxie_opc_info_t *opcode;
- opcode_hash_control =
hash_new
();
+ opcode_hash_control =
str_htab_create
();
/* Insert names into hash table. */
for (count = 0, opcode = moxie_form1_opc_info; count++ < 64; opcode++)
/* Insert names into hash table. */
for (count = 0, opcode = moxie_form1_opc_info; count++ < 64; opcode++)
-
hash_insert (opcode_hash_control, opcode->name, (char *) opcode
);
+
str_hash_insert (opcode_hash_control, opcode->name, opcode, 0
);
for (count = 0, opcode = moxie_form2_opc_info; count++ < 4; opcode++)
for (count = 0, opcode = moxie_form2_opc_info; count++ < 4; opcode++)
-
hash_insert (opcode_hash_control, opcode->name, (char *) opcode
);
+
str_hash_insert (opcode_hash_control, opcode->name, opcode, 0
);
for (count = 0, opcode = moxie_form3_opc_info; count++ < 10; opcode++)
for (count = 0, opcode = moxie_form3_opc_info; count++ < 10; opcode++)
- hash_insert (opcode_hash_control, opcode->name, (char *) opcode);
-
- target_big_endian = TARGET_BYTES_BIG_ENDIAN;
+ str_hash_insert (opcode_hash_control, opcode->name, opcode, 0);
bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0);
}
bfd_set_arch_mach (stdoutput, TARGET_ARCH, 0);
}
@@
-180,7
+178,7
@@
md_assemble (char *str)
if (nlen == 0)
as_bad (_("can't find opcode "));
if (nlen == 0)
as_bad (_("can't find opcode "));
- opcode = (moxie_opc_info_t *) hash_find (opcode_hash_control, op_start);
+ opcode = (moxie_opc_info_t *)
str_
hash_find (opcode_hash_control, op_start);
*op_end = pend;
if (opcode == NULL)
*op_end = pend;
if (opcode == NULL)
@@
-531,15
+529,23
@@
md_assemble (char *str)
(p - frag_now->fr_literal),
2,
&arg,
(p - frag_now->fr_literal),
2,
&arg,
-
TRUE
,
+
true
,
BFD_RELOC_MOXIE_10_PCREL);
}
break;
BFD_RELOC_MOXIE_10_PCREL);
}
break;
+ case MOXIE_BAD:
+ iword = 0;
+ while (ISSPACE (*op_end))
+ op_end++;
+ if (*op_end != 0)
+ as_warn (_("extra stuff on line ignored"));
+ break;
default:
abort ();
}
md_number_to_chars (p, iword, 2);
default:
abort ();
}
md_number_to_chars (p, iword, 2);
+ dwarf2_emit_insn (2);
while (ISSPACE (*op_end))
op_end++;
while (ISSPACE (*op_end))
op_end++;
@@
-556,7
+562,7
@@
md_assemble (char *str)
of LITTLENUMS emitted is stored in *SIZEP . An error message is
returned, or NULL on OK. */
of LITTLENUMS emitted is stored in *SIZEP . An error message is
returned, or NULL on OK. */
-char *
+c
onst c
har *
md_atof (int type, char *litP, int *sizeP)
{
int prec;
md_atof (int type, char *litP, int *sizeP)
{
int prec;
@@
-612,7
+618,7
@@
size_t md_longopts_size = sizeof (md_longopts);
const char *md_shortopts = "";
int
const char *md_shortopts = "";
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, c
onst c
har *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
{
switch (c)
{
@@
-771,9
+777,8
@@
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
return 0;
}
return 0;
}
- relP = xmalloc (sizeof (arelent));
- gas_assert (relP != 0);
- relP->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ relP = XNEW (arelent);
+ relP->sym_ptr_ptr = XNEW (asymbol *);
*relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
*relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;