diff options
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r-- | gas/config/tc-ppc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 23a84a7..1d2c57f 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2569,14 +2569,13 @@ ppc_apuinfo_section_add (unsigned int apu, unsigned int version) if (ppc_apuinfo_num_alloc == 0) { ppc_apuinfo_num_alloc = 4; - ppc_apuinfo_list = (unsigned long *) - xmalloc (sizeof (unsigned long) * ppc_apuinfo_num_alloc); + ppc_apuinfo_list = XNEWVEC (unsigned long, ppc_apuinfo_num_alloc); } else { ppc_apuinfo_num_alloc += 4; - ppc_apuinfo_list = (unsigned long *) xrealloc (ppc_apuinfo_list, - sizeof (unsigned long) * ppc_apuinfo_num_alloc); + ppc_apuinfo_list = XRESIZEVEC (unsigned long, ppc_apuinfo_list, + ppc_apuinfo_num_alloc); } } ppc_apuinfo_list[ppc_apuinfo_num++] = APUID (apu, version); @@ -3519,7 +3518,7 @@ ppc_macro (char *str, const struct powerpc_macro *macro) } /* Put the string together. */ - complete = s = (char *) xmalloc (len + 1); + complete = s = XNEWVEC (char, len + 1); format = macro->format; while (*format != '\0') { @@ -4010,8 +4009,7 @@ ppc_dwsect (int ignore ATTRIBUTE_UNUSED) else { /* Create a new dw subsection. */ - subseg = (struct dw_subsection *) - xmalloc (sizeof (struct dw_subsection)); + subseg = XNEW (struct dw_subsection); if (opt_label == NULL) { @@ -4964,7 +4962,7 @@ ppc_machine (int ignore ATTRIBUTE_UNUSED) if (strcmp (cpu_string, "push") == 0) { if (cpu_history == NULL) - cpu_history = xmalloc (MAX_HISTORY * sizeof (*cpu_history)); + cpu_history = XNEWVEC (ppc_cpu_t, MAX_HISTORY); if (curr_hist >= MAX_HISTORY) as_bad (_(".machine stack overflow")); @@ -7133,9 +7131,9 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { arelent *reloc; - reloc = (arelent *) xmalloc (sizeof (arelent)); + reloc = XNEW (arelent); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + 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; reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); |