+Tue Apr 5 11:22:38 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
+ section->relocation is NULL; malloc might have returned NULL when
+ given a zero size if there were no relocations.
+ * bout.c (b_out_canonicalize_reloc): Likewise.
+ * coffcode.h (coff_canonicalize_reloc): Likewise.
+ * ecoff.c (ecoff_canonicalize_reloc): Likewise.
+ * elfcode.h (elf_canonicalize_reloc): Likewise.
+ * mipsbsd.c (MY(canonicalize_reloc)): Likewise.
+ * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
+ * nlmcode.h (nlm_canonicalize_reloc): Likewise.
+ * som.c (som_canonicalize_reloc): Likewise.
+ * hp300hpux.c (MY(slurp_reloc_table)): Likewise. Also, if malloc
+ returns NULL, don't report an error if we asked for zero bytes.
+ * i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns
+ NULL, don't report an error if we asked for zero bytes.
+ * nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
+
Mon Apr 4 15:30:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* aoutx.h (NAME(aout,bfd_free_cached_info)): Don't free anything
}
else {
tblptr = section->relocation;
- if (!tblptr) return 0;
for (count = 0; count++ < section->reloc_count;)
{
arelent *tblptr = section->relocation;
unsigned int count = 0;
- if (!(tblptr || b_out_slurp_reloc_table (abfd, section, symbols)))
- return -1;
+ if (!(tblptr || b_out_slurp_reloc_table (abfd, section, symbols)))
+ return -1;
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (; count++ < section->reloc_count;)
*relptr++ = tblptr++;
return -1;
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (; count++ < section->reloc_count;)
*relptr++ = tblptr++;
return -1;
tblptr = section->relocation;
- if (tblptr == (arelent *) NULL)
- return -1;
for (count = 0; count < section->reloc_count; count++)
*relptr++ = tblptr++;
}
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (; count++ < section->reloc_count;)
*relptr++ = tblptr++;
reloc_cache = (arelent *) bfd_zalloc (abfd, (size_t) (count * sizeof
(arelent)));
- if (!reloc_cache)
+ if (!reloc_cache && count != 0)
{
nomem:
bfd_set_error (bfd_error_no_memory);
}
relocs = (PTR) bfd_alloc (abfd, reloc_size);
- if (!relocs)
+ if (!relocs && reloc_size != 0)
{
bfd_release (abfd, reloc_cache);
goto nomem;
else
{
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (count = 0; count++ < section->reloc_count;)
{
memset (reloc_cache, 0, count * sizeof (arelent));
relocs = (PTR) bfd_alloc (abfd, reloc_size);
- if (!relocs)
+ if (!relocs && reloc_size != 0)
{
free (reloc_cache);
goto nomem;
arelent *tblptr = section->relocation;
unsigned int count;
- if (!(tblptr || NAME (lynx, slurp_reloc_table) (abfd, section, symbols)))
+ if (!(tblptr || NAME(lynx,slurp_reloc_table) (abfd, section, symbols)))
return -1;
if (section->flags & SEC_CONSTRUCTOR)
else
{
tblptr = section->relocation;
- if (!tblptr)
- return -1;
for (count = 0; count++ < section->reloc_count;)
{
if (!NAME(aout,slurp_reloc_table)(abfd, section, symbols))
return -1;
tblptr = section->relocation;
- if (!tblptr)
- return -1;
/* fix up howto entries */
for (count = 0; count++ < section->reloc_count;)
count = nlm_fixed_header (abfd)->numberOfRelocationFixups;
rels = (arelent *) bfd_alloc (abfd, count * sizeof (arelent));
secs = (asection **) bfd_alloc (abfd, count * sizeof (asection *));
- if (rels == NULL || secs == NULL)
+ if ((rels == NULL || secs == NULL) && count != 0)
{
bfd_set_error (bfd_error_no_memory);
return false;
if (nlm_slurp_reloc_fixups (abfd) == false)
return -1;
rels = nlm_relocation_fixups (abfd);
- if (rels == NULL)
- return -1;
}
secs = nlm_relocation_fixup_secs (abfd);
count = section->reloc_count;
tblptr = section->relocation;
- if (tblptr == (arelent *) NULL)
- return -1;
while (count--)
*relptr++ = tblptr++;