From 3ad27ade45eec627eb9bac318ed4f7ab63a60861 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 10 Feb 2013 04:36:28 +0000 Subject: * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc. * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. * m68klinux.c (linux_link_hash_table_create): Likewise. * sparclinux.c (linux_link_hash_table_create): Likewise. * sunos.c (sunos_link_hash_table_create): Likewise. * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise. * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise. * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise. * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise. * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise. * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise. * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. * elf32-metag.c (elf_metag_link_hash_table_create): Likewise. * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise. * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. * elf32-score.c (elf32_score_link_hash_table_create): Likewise. * elf32-spu.c (spu_elf_link_hash_table_create): Likewise. * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise. * elf32-vax.c (elf_vax_link_hash_table_create): Likewise. * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise. * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise. * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise. * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. * elflink.c (_bfd_elf_link_hash_table_create): Likewise. (_bfd_elf_link_hash_table_init): Assume zero fill table on entry. --- bfd/elf32-xgate.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'bfd/elf32-xgate.c') diff --git a/bfd/elf32-xgate.c b/bfd/elf32-xgate.c index 2169c569b4..ad2190b3a2 100644 --- a/bfd/elf32-xgate.c +++ b/bfd/elf32-xgate.c @@ -448,11 +448,10 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd) struct xgate_elf_link_hash_table *ret; bfd_size_type amt = sizeof(struct xgate_elf_link_hash_table); - ret = (struct xgate_elf_link_hash_table *) bfd_malloc (amt); + ret = (struct xgate_elf_link_hash_table *) bfd_zmalloc (amt); if (ret == (struct xgate_elf_link_hash_table *) NULL) return NULL; - memset (ret, 0, amt); if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, _bfd_elf_link_hash_newfunc, sizeof(struct elf_link_hash_entry), XGATE_ELF_DATA)) @@ -463,7 +462,7 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd) /* Init the stub hash table too. */ amt = sizeof(struct bfd_hash_table); - ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt); + ret->stub_hash_table = (struct bfd_hash_table*) bfd_zmalloc (amt); if (ret->stub_hash_table == NULL) { free (ret); @@ -472,12 +471,11 @@ xgate_elf_bfd_link_hash_table_create (bfd *abfd) if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc, sizeof(struct elf32_xgate_stub_hash_entry))) - return NULL; - - ret->stub_bfd = NULL; - ret->stub_section = 0; - ret->add_stub_section = NULL; - ret->sym_cache.abfd = NULL; + { + free (ret->stub_hash_table); + free (ret); + return NULL; + } return &ret->root.root; } -- cgit v1.2.1