X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-ppc.c;h=6346570ac34c1de6b47e959cb41d742b4b5810b6;hb=f85d59c30681f55150bf28225b3873fe2d4b6bf7;hp=23a84a78f6ee20cf0da85f2ed5e7d818121657c3;hpb=a44e2901c749445d16ba1e3875b50af9c4bbb3c5;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 23a84a78f6..6346570ac3 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -206,11 +206,13 @@ ppc_cpu_t sticky = 0; /* Value for ELF e_flags EF_PPC64_ABI. */ unsigned int ppc_abiversion = 0; +#ifdef OBJ_ELF /* Flags set on encountering toc relocs. */ -enum { +static enum { has_large_toc_reloc = 1, has_small_toc_reloc = 2 } toc_reloc_types; +#endif /* Warn on emitting data to code sections. */ int warn_476; @@ -2569,14 +2571,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 +3520,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 +4011,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 +4964,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 +7133,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);