OSDN Git Service

Replace bfd_alloc/bfd_malloc + memset with bfd_zalloc/bfd_zmalloc
[pf3gnuchains/pf3gnuchains4x.git] / bfd / cofflink.c
index 1eac3c5..32200a8 100644 (file)
@@ -342,12 +342,10 @@ coff_link_add_symbols (abfd, info)
   /* We keep a list of the linker hash table entries that correspond
      to particular symbols.  */
   amt = symcount * sizeof (struct coff_link_hash_entry *);
-  sym_hash = (struct coff_link_hash_entry **) bfd_alloc (abfd, amt);
+  sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt);
   if (sym_hash == NULL && symcount != 0)
     goto error_return;
   obj_coff_sym_hashes (abfd) = sym_hash;
-  memset (sym_hash, 0,
-         (size_t) symcount * sizeof (struct coff_link_hash_entry *));
 
   symesz = bfd_coff_symesz (abfd);
   BFD_ASSERT (symesz == bfd_coff_auxesz (abfd));