bfd_reloc_code_real_type r_type = fixP->fx_r_type;
arelent *reloc;
- reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
#ifdef GAS_CGEN_PCREL_R_TYPE
if (fixP->fx_pcrel)
#endif
reloc->howto = bfd_reloc_type_lookup (stdoutput, r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("relocation is not supported"));
gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
-
/* Use fx_offset for these cases. */
if (fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
|| fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
pname = symbol_get_bfdsym (sym)->name;
}
- udata = XNEW (struct evax_private_udata_struct);
+ udata = notes_alloc (sizeof (*udata));
udata->enbsym = symbol_get_bfdsym (fixp->fx_addsy);
udata->bsym = symbol_get_bfdsym (fixp->tc_fix_data.info->psym);
udata->origname = (char *)pname;
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
arelent * reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
return NULL;
}
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
/* xgettext:c-format. */
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
-
- xfree (reloc);
-
return NULL;
}
bfd_reloc_code_real_type r_type = fixP->fx_r_type;
arelent *reloc;
- reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
if (fixP->fx_pcrel)
{
return NULL;
}
- //XXX gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
-
/* Use fx_offset for these cases. */
if (fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
|| fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
&& (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)))
return NULL;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
reloc->addend = fixP->fx_offset;
{
/* We only resolve difference expressions in the same section. */
as_bad_subtract (fixP);
- free (reloc->sym_ptr_ptr);
- free (reloc);
return NULL;
}
}
return 0;
}
- relP = XNEW (arelent);
- gas_assert (relP != 0);
- relP->sym_ptr_ptr = XNEW (asymbol *);
+ relP = notes_alloc (sizeof (arelent));
+ relP->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
{
arelent * reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
reloc->addend = fixP->fx_offset;
{
/* We only resolve difference expressions in the same section. */
as_bad_subtract (fixP);
- free (reloc->sym_ptr_ptr);
- free (reloc);
return NULL;
}
}
if (fixP->fx_pcrel
&& fixP->fx_r_type == BFD_RELOC_CKCORE_ADDR32)
- fixP->fx_r_type = BFD_RELOC_CKCORE_PCREL32;
+ fixP->fx_r_type = BFD_RELOC_CKCORE_PCREL32;
- rel = xmalloc (sizeof (arelent));
- rel->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
rel->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
rel->addend = fixP->fx_offset;
tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (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);
tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (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);
{
arelent * reloc;
- reloc = XNEW (arelent);
- reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
- 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;
if (fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
return NULL;
}
- relP = XNEW (arelent);
- gas_assert (relP != 0);
- relP->sym_ptr_ptr = XNEW (asymbol *);
+ relP = notes_alloc (sizeof (arelent));
+ relP->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
}
}
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
rel->addend = fixp->fx_offset;
int n_relocs;
int i;
- hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data;
if (fixp->fx_addsy == 0)
return &no_relocs;
+ hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data;
gas_assert (hppa_fixp != 0);
gas_assert (section != 0);
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
-
/* Allow fixup_segment to recognize hand-written pc-relative relocations.
When we went through cons_fix_new_hppa, we classified them as complex. */
/* ??? It might be better to hide this +8 stuff in tc_cfi_emit_pcrel_expr,
for (n_relocs = 0; codes[n_relocs]; n_relocs++)
;
- relocs = XNEWVEC (arelent *, n_relocs + 1);
- reloc = XNEWVEC (arelent, n_relocs);
+ relocs = notes_alloc (sizeof (*relocs) * (n_relocs + 1));
+ reloc = notes_alloc (sizeof (*reloc) * n_relocs);
for (i = 0; i < n_relocs; i++)
relocs[i] = &reloc[i];
-
relocs[n_relocs] = NULL;
#ifdef OBJ_ELF
break;
}
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->howto = bfd_reloc_type_lookup (stdoutput,
(bfd_reloc_code_real_type) code);
{
code = *codes[i];
- relocs[i]->sym_ptr_ptr = XNEW (asymbol *);
+ relocs[i]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
relocs[i]->howto =
bfd_reloc_type_lookup (stdoutput,
of two symbols. With that in mind we fill in all four
relocs now and break out of the loop. */
gas_assert (i == 1);
+ /* relocs[0] and relocs[1] have been initialised above. We can
+ use relocs[0]->sym_ptr_ptr allocation for relocs[2]. */
+ relocs[2]->sym_ptr_ptr = relocs[0]->sym_ptr_ptr;
relocs[0]->sym_ptr_ptr = &bfd_abs_section_ptr->symbol;
- relocs[0]->howto
- = bfd_reloc_type_lookup (stdoutput,
- (bfd_reloc_code_real_type) *codes[0]);
- relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[0]->addend = 0;
- relocs[1]->sym_ptr_ptr = XNEW (asymbol *);
- *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- relocs[1]->howto
- = bfd_reloc_type_lookup (stdoutput,
- (bfd_reloc_code_real_type) *codes[1]);
- relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
relocs[1]->addend = 0;
- relocs[2]->sym_ptr_ptr = XNEW (asymbol *);
*relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
relocs[2]->howto
= bfd_reloc_type_lookup (stdoutput,
case R_N0SEL:
case R_N1SEL:
/* There is no symbol or addend associated with these fixups. */
- relocs[i]->sym_ptr_ptr = XNEW (asymbol *);
*relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
relocs[i]->addend = 0;
break;
case R_ENTRY:
case R_EXIT:
/* There is no symbol associated with these fixups. */
- relocs[i]->sym_ptr_ptr = XNEW (asymbol *);
*relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol);
relocs[i]->addend = fixp->fx_offset;
break;
code = BFD_RELOC_X86_64_GOTPC64;
}
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;
as_bad_where (fixp->fx_file, fixp->fx_line,
_("Cannot represent %s relocation in object file"),
bfd_get_reloc_code_name (fixp->fx_r_type));
- free (reloc);
return NULL;
}
return reloc;
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = (arelent *) xmalloc (sizeof (arelent));
-
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
arelent *
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
{
- arelent *reloc = (arelent *) xmalloc (sizeof (arelent));
+ arelent *reloc;
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;
|| fx->fx_r_type == BFD_RELOC_M32C_RL_1ADDR
|| fx->fx_r_type == BFD_RELOC_M32C_RL_2ADDR)
{
- arelent * reloc;
+ arelent *reloc;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fx->fx_addsy);
reloc->address = fx->fx_frag->fr_address + fx->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fx->fx_r_type);
arelent * reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
printf(" => %s\n",reloc->howto->name);
#endif
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
_("internal error: can't export reloc type %d (`%s')"),
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
if (fixp->fx_r_type == 0)
#undef F
#undef MAP
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
if (!fixp->fx_pcrel)
break;
}
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (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! */
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
/* xgettext:c-format. */
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
-
- xfree (reloc);
-
return NULL;
}
break;
}
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
if (code == BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM)
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
arelent *reloc;
bfd_reloc_code_real_type code;
- memset (retval, 0, sizeof(retval));
- reloc = retval[0] = XCNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ memset (retval, 0, sizeof (retval));
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ retval[0] = reloc;
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
return NULL;
}
- relP = XNEW (arelent);
- gas_assert (relP != 0);
- relP->sym_ptr_ptr = XNEW (asymbol *);
+ relP = notes_alloc (sizeof (arelent));
+ relP->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*relP->sym_ptr_ptr = baddsy;
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
arelent *reloc;
- reloc = XNEW (arelent);
+
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
if (fixp->fx_subsy != NULL)
{
return NULL;
}
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc->sym_ptr_ptr = XNEW (asymbol *);
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->addend = fixp->fx_offset;
return reloc;
}
static arelent * relocs[MAX_RELOC_EXPANSION + 1];
arelent *reloc;
- reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
if (reloc->howto == NULL)
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
- free (reloc);
- return & no_relocs;
+ return &no_relocs;
}
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
even local symbols defined in the same section. */
if (ssec != absolute_section || asec != absolute_section)
{
- arelent * reloc2 = XNEW (arelent);
+ arelent *reloc2 = notes_alloc (sizeof (arelent));
relocs[0] = reloc2;
relocs[1] = reloc;
reloc2->address = reloc->address;
reloc2->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_MN10300_SYM_DIFF);
reloc2->addend = - S_GET_VALUE (fixp->fx_subsy);
- reloc2->sym_ptr_ptr = XNEW (asymbol *);
+ reloc2->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc2->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
reloc->addend = fixp->fx_offset;
}
else
{
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
}
return relocs;
}
- free (reloc);
- return & no_relocs;
+ return &no_relocs;
}
}
else
{
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->addend = fixp->fx_offset;
}
return 0;
}
- relP = XNEW (arelent);
- relP->sym_ptr_ptr = XNEW (asymbol *);
+ relP = notes_alloc (sizeof (arelent));
+ relP->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
then it is done here. */
arelent **
-tc_gen_reloc (asection * seg ATTRIBUTE_UNUSED, fixS * fixp)
+tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
- static arelent * no_relocs = NULL;
- static arelent * relocs[MAX_RELOC_EXPANSION + 1];
+ static arelent *no_relocs = NULL;
+ static arelent *relocs[MAX_RELOC_EXPANSION + 1];
arelent *reloc;
- reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
- free (reloc);
- return & no_relocs;
+ return &no_relocs;
}
relocs[0] = reloc;
&& ! S_IS_GAS_LOCAL (fixp->fx_addsy)
&& ! S_IS_GAS_LOCAL (fixp->fx_subsy))
{
- arelent * reloc2 = XNEW (arelent);
+ arelent *reloc2 = notes_alloc (sizeof (arelent));
relocs[0] = reloc2;
relocs[1] = reloc;
reloc2->sym_ptr_ptr = &bfd_abs_section_ptr->symbol;
else
{
- reloc2->sym_ptr_ptr = XNEW (asymbol *);
+ reloc2->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc2->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
}
}
else
{
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
}
return relocs;
}
- free (reloc);
- return & no_relocs;
+ return &no_relocs;
}
}
else
char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
md_number_to_chars (fixpos, amount, 2);
- free (reloc);
- return & no_relocs;
+ return &no_relocs;
}
#endif
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->addend = fixp->fx_offset;
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
code = reloc (fixp->fx_size, fixp->fx_pcrel, fix_im_disp (fixp));
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
if (fixp->fx_pcrel)
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
arelent *rel;
bfd_reloc_code_real_type r_type;
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
static arelent *relocs[3];
arelent *reloc;
- relocs[0] = reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ relocs[0] = reloc;
relocs[1] = NULL;
-
- 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;
/* BFD_RELOC_PPC64_TLS_PCREL generates R_PPC64_TLS with an odd r_offset. */
if (fixp->fx_r_type == BFD_RELOC_PPC64_TLS_PCREL)
reloc->address++;
reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
- if (reloc->howto == (reloc_howto_type *) NULL)
+ if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
if (fixp->fx_subsy != NULL)
{
- relocs[1] = reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ relocs[1] = reloc;
relocs[2] = NULL;
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
if (reloc->howto == (reloc_howto_type *) NULL)
{
as_bad_subtract (fixp);
- free (relocs[1]->sym_ptr_ptr);
- free (relocs[1]);
- free (relocs[0]->sym_ptr_ptr);
- free (relocs[0]);
relocs[0] = NULL;
}
}
-
return relocs;
}
arelent *
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
{
- arelent *reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ arelent *reloc;
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset; /* fixp->fx_addnumber; */
arelent *
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
{
- arelent *reloc = (arelent *) xmalloc (sizeof (arelent));
+ arelent *reloc;
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_addnumber;
fixp->fx_subsy = NULL;
}
- reloc[0] = XNEW (arelent);
- reloc[0]->sym_ptr_ptr = XNEW (asymbol *);
- * reloc[0]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[0]->addend = fixp->fx_offset;
+ reloc[0] = notes_alloc (sizeof (arelent));
+ reloc[0]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc[0]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ reloc[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[0]->addend = fixp->fx_offset;
if (fixp->fx_r_type == BFD_RELOC_RL78_32_OP
&& fixp->fx_subsy)
fixp->fx_r_type = BFD_RELOC_RL78_DIFF;
}
-#define OPX(REL,SYM,ADD) \
- reloc[rp] = XNEW (arelent); \
- reloc[rp]->sym_ptr_ptr = XNEW (asymbol *); \
- reloc[rp]->howto = bfd_reloc_type_lookup (stdoutput, REL); \
- reloc[rp]->addend = ADD; \
- * reloc[rp]->sym_ptr_ptr = SYM; \
- reloc[rp]->address = fixp->fx_frag->fr_address + fixp->fx_where; \
+#define OPX(REL,SYM,ADD) \
+ reloc[rp] = notes_alloc (sizeof (arelent)); \
+ reloc[rp]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *)); \
+ reloc[rp]->howto = bfd_reloc_type_lookup (stdoutput, REL); \
+ reloc[rp]->addend = ADD; \
+ *reloc[rp]->sym_ptr_ptr = SYM; \
+ reloc[rp]->address = fixp->fx_frag->fr_address + fixp->fx_where; \
reloc[++rp] = NULL
#define OPSYM(SYM) OPX(BFD_RELOC_RL78_SYM, SYM, 0)
fixp->fx_subsy = NULL;
}
- reloc[0] = XNEW (arelent);
- reloc[0]->sym_ptr_ptr = XNEW (asymbol *);
- * reloc[0]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[0]->addend = fixp->fx_offset;
+ reloc[0] = notes_alloc (sizeof (arelent));
+ reloc[0]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc[0]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
+ reloc[0]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[0]->addend = fixp->fx_offset;
if (fixp->fx_r_type == BFD_RELOC_RX_32_OP
&& fixp->fx_subsy)
switch (fixp->fx_r_type)
{
case BFD_RELOC_RX_DIFF:
- reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
-
- reloc[1] = XNEW (arelent);
- reloc[1]->sym_ptr_ptr = XNEW (asymbol *);
- * reloc[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
- reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[1]->addend = 0;
- reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
-
- reloc[2] = XNEW (arelent);
- reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
- reloc[2]->addend = 0;
- reloc[2]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
-
- reloc[3] = XNEW (arelent);
+ reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+
+ reloc[1] = notes_alloc (sizeof (arelent));
+ reloc[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ *reloc[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy);
+ reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[1]->addend = 0;
+ reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+
+ reloc[2] = notes_alloc (sizeof (arelent));
+ reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
+ reloc[2]->addend = 0;
+ reloc[2]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
+ reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+
+ reloc[3] = notes_alloc (sizeof (arelent));
switch (fixp->fx_size)
{
case 1:
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS8);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS8);
break;
case 2:
if (!is_opcode && target_big_endian)
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16_REV);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16_REV);
else if (is_opcode)
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UL);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UL);
else
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16);
break;
case 4:
if (!is_opcode && target_big_endian)
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32_REV);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32_REV);
else
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32);
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32);
break;
}
- reloc[3]->addend = 0;
+ reloc[3]->addend = 0;
reloc[3]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc[4] = NULL;
break;
case BFD_RELOC_RX_GPRELL:
- reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+ reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
- reloc[1] = XNEW (arelent);
- reloc[1]->sym_ptr_ptr = XNEW (asymbol *);
+ reloc[1] = notes_alloc (sizeof (arelent));
+ reloc[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
if (gp_symbol == NULL)
{
if (symbol_table_frozen)
else
gp_symbol = symbol_get_bfdsym (symbol_find_or_make ("__gp"));
}
- * reloc[1]->sym_ptr_ptr = gp_symbol;
- reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[1]->addend = 0;
- reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
-
- reloc[2] = XNEW (arelent);
- reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
- reloc[2]->addend = 0;
+ *reloc[1]->sym_ptr_ptr = gp_symbol;
+ reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[1]->addend = 0;
+ reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+
+ reloc[2] = notes_alloc (sizeof (arelent));
+ reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
+ reloc[2]->addend = 0;
reloc[2]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[3] = XNEW (arelent);
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UL);
- reloc[3]->addend = 0;
+ reloc[3] = notes_alloc (sizeof (arelent));
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UL);
+ reloc[3]->addend = 0;
reloc[3]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc[4] = NULL;
break;
case BFD_RELOC_RX_GPRELW:
- reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+ reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
- reloc[1] = XNEW (arelent);
- reloc[1]->sym_ptr_ptr = XNEW (asymbol *);
+ reloc[1] = notes_alloc (sizeof (arelent));
+ reloc[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
if (gp_symbol == NULL)
{
if (symbol_table_frozen)
else
gp_symbol = symbol_get_bfdsym (symbol_find_or_make ("__gp"));
}
- * reloc[1]->sym_ptr_ptr = gp_symbol;
- reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[1]->addend = 0;
- reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
-
- reloc[2] = XNEW (arelent);
- reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
- reloc[2]->addend = 0;
+ *reloc[1]->sym_ptr_ptr = gp_symbol;
+ reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[1]->addend = 0;
+ reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+
+ reloc[2] = notes_alloc (sizeof (arelent));
+ reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
+ reloc[2]->addend = 0;
reloc[2]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[3] = XNEW (arelent);
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UW);
- reloc[3]->addend = 0;
+ reloc[3] = notes_alloc (sizeof (arelent));
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16UW);
+ reloc[3]->addend = 0;
reloc[3]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc[4] = NULL;
break;
case BFD_RELOC_RX_GPRELB:
- reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+ reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
- reloc[1] = XNEW (arelent);
- reloc[1]->sym_ptr_ptr = XNEW (asymbol *);
+ reloc[1] = notes_alloc (sizeof (arelent));
+ reloc[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
if (gp_symbol == NULL)
{
if (symbol_table_frozen)
else
gp_symbol = symbol_get_bfdsym (symbol_find_or_make ("__gp"));
}
- * reloc[1]->sym_ptr_ptr = gp_symbol;
- reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[1]->addend = 0;
- reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
-
- reloc[2] = XNEW (arelent);
- reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
- reloc[2]->addend = 0;
+ *reloc[1]->sym_ptr_ptr = gp_symbol;
+ reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[1]->addend = 0;
+ reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+
+ reloc[2] = notes_alloc (sizeof (arelent));
+ reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_SUBTRACT);
+ reloc[2]->addend = 0;
reloc[2]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[3] = XNEW (arelent);
- reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16U);
- reloc[3]->addend = 0;
+ reloc[3] = notes_alloc (sizeof (arelent));
+ reloc[3]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS16U);
+ reloc[3]->addend = 0;
reloc[3]->sym_ptr_ptr = reloc[1]->sym_ptr_ptr;
- reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[3]->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc[4] = NULL;
break;
case BFD_RELOC_RX_NEG32:
- reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
+ reloc[0]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_SYM);
- reloc[1] = XNEW (arelent);
- reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_NEG);
- reloc[1]->addend = 0;
+ reloc[1] = notes_alloc (sizeof (arelent));
+ reloc[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_OP_NEG);
+ reloc[1]->addend = 0;
reloc[1]->sym_ptr_ptr = reloc[0]->sym_ptr_ptr;
- reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[1]->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc[2] = XNEW (arelent);
- reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32);
- reloc[2]->addend = 0;
+ reloc[2] = notes_alloc (sizeof (arelent));
+ reloc[2]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_RX_ABS32);
+ reloc[2]->addend = 0;
reloc[2]->sym_ptr_ptr = reloc[0]->sym_ptr_ptr;
- reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc[2]->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc[3] = NULL;
break;
arelent *
tc_gen_reloc (asection *section, fixS *fixp)
{
- arelent *reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ arelent *reloc;
+
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (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);
code = BFD_RELOC_390_GOTPCDBL;
}
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (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, code);
bfd_reloc_code_real_type code;
const char *type;
- reloc = retval[0] = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ retval[0] = reloc;
retval[1] = NULL;
-
- 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->addend = fixp->fx_offset;
newval |= (((off >> 14) & 0x3) << 16);
s3_md_number_to_chars (buf, newval, s3_INSN_SIZE);
- retval[1] = XNEW (arelent);
+ retval[1] = notes_alloc (sizeof (arelent));
+ retval[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
retval[2] = NULL;
- retval[1]->sym_ptr_ptr = XNEW (asymbol *);
*retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
retval[1]->address = (reloc->address + s3_RELAX_RELOC2 (fixp->fx_frag->fr_subtype));
bfd_reloc_code_real_type code;
const char *type;
- reloc = retval[0] = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ retval[0] = reloc;
retval[1] = NULL;
-
- 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->addend = fixp->fx_offset;
newval |= (((off >> 14) & 0x3) << 16);
s7_number_to_chars (buf, newval, s7_INSN_SIZE);
- retval[1] = XNEW (arelent);
+ retval[1] = notes_alloc (sizeof (arelent));
+ retval[2]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
retval[2] = NULL;
- retval[1]->sym_ptr_ptr = XNEW (asymbol *);
*retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
retval[1]->address = (reloc->address + s7_RELAX_RELOC2 (fixp->fx_frag->fr_subtype));
arelent *rel;
bfd_reloc_code_real_type r_type;
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;
arelent *reloc;
bfd_reloc_code_real_type code;
- relocs[0] = reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ relocs[0] = reloc;
relocs[1] = NULL;
-
- 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;
as_bad_where (fixp->fx_file, fixp->fx_line,
_("internal error: can't export reloc type %d (`%s')"),
fixp->fx_r_type, bfd_get_reloc_code_name (code));
- xfree (reloc);
relocs[0] = NULL;
return relocs;
}
on the same location. */
if (code == BFD_RELOC_SPARC_OLO10)
{
- relocs[1] = reloc = XNEW (arelent);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
+ relocs[1] = reloc;
relocs[2] = NULL;
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
*reloc->sym_ptr_ptr
= symbol_get_bfdsym (section_symbol (absolute_section));
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (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);
as_bad_where (fixp->fx_file, fixp->fx_line,
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
- free (reloc->sym_ptr_ptr);
- free (reloc);
return NULL;
}
reloc->addend = fixp->fx_addnumber;
#undef MAP
#undef F
- rel = XNEW (arelent);
- gas_assert (rel != 0);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
rel->addend = 0;
{
arelent *reloc;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
reloc->address /= OCTETS_PER_BYTE;
bfd_reloc_code_real_type code = fixP->fx_r_type;
asymbol *sym = symbol_get_bfdsym (fixP->fx_addsy);
- rel = XNEW (arelent);
- rel->sym_ptr_ptr = XNEW (asymbol *);
+ rel = notes_alloc (sizeof (arelent));
+ rel->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*rel->sym_ptr_ptr = sym;
/* We assume that all rel->address are host byte offsets. */
rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
asymbol *symbol;
bfd_reloc_code_real_type r_type;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
symbol = symbol_get_bfdsym (fixp->fx_addsy);
*reloc->sym_ptr_ptr = symbol;
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
if ( fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
|| fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
/* xgettext:c-format */
_("reloc %d not supported by object file format"),
(int) fixp->fx_r_type);
-
- xfree (reloc);
-
return NULL;
}
#undef F
#undef MAP
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
#ifndef OBJ_ELF
arelent *reloc;
bfd_reloc_code_real_type code;
- reloc = XNEW (arelent);
-
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = (arelent *) xmalloc (sizeof (*reloc));
- reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent * reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
as_bad_where (fixp->fx_file, fixp->fx_line,
_("cannot represent `%s' relocation in object file"),
bfd_get_reloc_code_name (fixp->fx_r_type));
- free (reloc->sym_ptr_ptr);
- free (reloc);
return NULL;
}
return NULL;
}
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
- reloc->addend = fixp->fx_offset;
- reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
+ reloc->addend = fixp->fx_offset;
+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
if (reloc->howto == NULL)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
{
arelent *reloc;
- reloc = XNEW (arelent);
- reloc->sym_ptr_ptr = XNEW (asymbol *);
+ reloc = notes_alloc (sizeof (arelent));
+ reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
reloc->addend = fixp->fx_offset;
rp = &r->next;
}
- relocs = XCNEWVEC (arelent *, n);
+ relocs = notes_alloc (n * sizeof (arelent *));
n = 0;
r = my_reloc_list;