aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2003-06-11 10:32:08 +0000
committerThiemo Seufer <ths@networkno.de>2003-06-11 10:32:08 +0000
commitd25d759de9c291677a64bf9e3150217a0a629e22 (patch)
treef148886da3f500a3e72a6bfd8ffd6d9fe57f4320 /gas
parentcbcdb1f584b5edb83525b3be63dc505d3f3cb695 (diff)
downloadfsf-binutils-gdb-d25d759de9c291677a64bf9e3150217a0a629e22.zip
fsf-binutils-gdb-d25d759de9c291677a64bf9e3150217a0a629e22.tar.gz
fsf-binutils-gdb-d25d759de9c291677a64bf9e3150217a0a629e22.tar.bz2
* write.c (write_relocs): Use xcalloc. Fix relocs initialization
in the RELOC_EXPANSION_POSSIBLE case.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/write.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d003215..eeb1a36 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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 '#'.
diff --git a/gas/write.c b/gas/write.c
index ce40572..3c6adf5 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -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)