* write.c (write_relocs): Use xcalloc. Fix relocs initialization
in the RELOC_EXPANSION_POSSIBLE case.
This commit is contained in:
parent
cbcdb1f584
commit
d25d759de9
2 changed files with 7 additions and 3 deletions
|
@ -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>
|
2003-06-11 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* config/tc-i960.c (line_comment_chars): Add '#'.
|
* config/tc-i960.c (line_comment_chars): Add '#'.
|
||||||
|
|
|
@ -938,8 +938,7 @@ write_relocs (abfd, sec, xxx)
|
||||||
|
|
||||||
#ifndef RELOC_EXPANSION_POSSIBLE
|
#ifndef RELOC_EXPANSION_POSSIBLE
|
||||||
/* Set up reloc information as well. */
|
/* Set up reloc information as well. */
|
||||||
relocs = (arelent **) xmalloc (n * sizeof (arelent *));
|
relocs = (arelent **) xcalloc (n, sizeof (arelent *));
|
||||||
memset ((char *) relocs, 0, n * sizeof (arelent *));
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
|
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
|
||||||
|
@ -1011,7 +1010,7 @@ write_relocs (abfd, sec, xxx)
|
||||||
#else
|
#else
|
||||||
n = n * MAX_RELOC_EXPANSION;
|
n = n * MAX_RELOC_EXPANSION;
|
||||||
/* Set up reloc information as well. */
|
/* Set up reloc information as well. */
|
||||||
relocs = (arelent **) xmalloc (n * sizeof (arelent *));
|
relocs = (arelent **) xcalloc (n, sizeof (arelent *));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
|
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
|
||||||
|
|
Loading…
Reference in a new issue