summaryrefslogtreecommitdiff
path: root/bfd/aoutx.h
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-26 18:30:28 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-26 18:30:28 +0000
commit257864504bc8a2555cc7cc3a2bc637c25e3ccedd (patch)
treea5504fa7a9cdd8f839580551d7b4e127ac5fbcee /bfd/aoutx.h
parent3fcaba6806be44f05812f14f3ff6b225a78c9bf3 (diff)
downloadbinutils-redhat-257864504bc8a2555cc7cc3a2bc637c25e3ccedd.tar.gz
2007-07-26 Michael Snyder <msnyder@access-company.com>
* aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero or count == zero.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r--bfd/aoutx.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 92e82ae346..e07d7bef39 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -2280,20 +2280,25 @@ NAME (aout, slurp_reloc_table) (bfd *abfd, sec_ptr asect, asymbol **symbols)
return FALSE;
}
+ if (reloc_size == 0)
+ return TRUE; /* Nothing to be done. */
+
if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0)
return FALSE;
each_size = obj_reloc_entry_size (abfd);
count = reloc_size / each_size;
+ if (count == 0)
+ return TRUE; /* Nothing to be done. */
amt = count * sizeof (arelent);
reloc_cache = bfd_zmalloc (amt);
- if (reloc_cache == NULL && count != 0)
+ if (reloc_cache == NULL)
return FALSE;
relocs = bfd_malloc (reloc_size);
- if (relocs == NULL && reloc_size != 0)
+ if (relocs == NULL)
{
free (reloc_cache);
return FALSE;