Browse Source

elf: Call bfd_malloc instead xmalloc

* elflink.c (elf_link_add_object_symbols): Call bfd_malloc
	instead of xmalloc.
master
H.J. Lu 2 years ago
parent
commit
c411ee9883
  1. 11
      bfd/elflink.c

11
bfd/elflink.c

@ -4378,12 +4378,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{ {
/* Initialize first_hash for an IR input. */ /* Initialize first_hash for an IR input. */
htab->first_hash = (struct bfd_hash_table *) htab->first_hash = (struct bfd_hash_table *)
xmalloc (sizeof (struct bfd_hash_table)); bfd_malloc (sizeof (struct bfd_hash_table));
if (!bfd_hash_table_init if (htab->first_hash == NULL
(htab->first_hash, elf_link_first_hash_newfunc, || !bfd_hash_table_init
sizeof (struct elf_link_first_hash_entry))) (htab->first_hash, elf_link_first_hash_newfunc,
sizeof (struct elf_link_first_hash_entry)))
info->callbacks->einfo info->callbacks->einfo
(_("%F%P: first_hash failed to initialize: %E\n")); (_("%F%P: first_hash failed to create: %E\n"));
} }
} }
else else

Loading…
Cancel
Save