summaryrefslogtreecommitdiff
path: root/gas/config/tc-xgate.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-xgate.c')
-rw-r--r--gas/config/tc-xgate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c
index 1d68edcd85c..769d158ca33 100644
--- a/gas/config/tc-xgate.c
+++ b/gas/config/tc-xgate.c
@@ -298,8 +298,7 @@ md_begin (void)
/* Create a local copy of our opcode table
including an extra line for NULL termination. */
- xgate_op_table = (struct xgate_opcode *)
- xmalloc ((xgate_num_opcodes) * sizeof (struct xgate_opcode));
+ xgate_op_table = XNEWVEC (struct xgate_opcode, xgate_num_opcodes);
memset (xgate_op_table, 0,
sizeof(struct xgate_opcode) * (xgate_num_opcodes));
@@ -322,8 +321,7 @@ md_begin (void)
prev_op_name = xgate_opcode_ptr->name;
}
- op_handles = (struct xgate_opcode_handle *)
- xmalloc (sizeof(struct xgate_opcode_handle) * (number_of_op_handles));
+ op_handles = XNEWVEC (struct xgate_opcode_handle, number_of_op_handles);
/* Insert unique opcode names into hash table, aliasing duplicates. */
xgate_hash = hash_new ();
@@ -616,8 +614,8 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
{
arelent * reloc;
- reloc = (arelent *) xmalloc (sizeof(arelent));
- 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;