]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* write.c (write_relocs): Use xcalloc. Fix relocs initialization
authorThiemo Seufer <ths@networkno.de>
Wed, 11 Jun 2003 10:32:08 +0000 (10:32 +0000)
committerThiemo Seufer <ths@networkno.de>
Wed, 11 Jun 2003 10:32:08 +0000 (10:32 +0000)
in the RELOC_EXPANSION_POSSIBLE case.

gas/ChangeLog
gas/write.c

index d00321537383db9f062f40910ca5f4263e1ef07f..eeb1a36b49a86a7e2dcec7ec4675d17fdc2a2401 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-11  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * write.c (write_relocs): Use xcalloc. Fix relocs initialization
+       in the RELOC_EXPANSION_POSSIBLE case.
+
 2003-06-11  Alan Modra  <amodra@bigpond.net.au>
 
        * config/tc-i960.c (line_comment_chars): Add '#'.
index ce40572749cc967079f327ee23b413425d559b06..3c6adf51d1ac23b1a469bca8a14a85579ea78e0a 100644 (file)
@@ -938,8 +938,7 @@ write_relocs (abfd, sec, xxx)
 
 #ifndef RELOC_EXPANSION_POSSIBLE
   /* Set up reloc information as well.  */
-  relocs = (arelent **) xmalloc (n * sizeof (arelent *));
-  memset ((char *) relocs, 0, n * sizeof (arelent *));
+  relocs = (arelent **) xcalloc (n, sizeof (arelent *));
 
   i = 0;
   for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
@@ -1011,7 +1010,7 @@ write_relocs (abfd, sec, xxx)
 #else
   n = n * MAX_RELOC_EXPANSION;
   /* Set up reloc information as well.  */
-  relocs = (arelent **) xmalloc (n * sizeof (arelent *));
+  relocs = (arelent **) xcalloc (n, sizeof (arelent *));
 
   i = 0;
   for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)