aboutsummaryrefslogtreecommitdiff
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
commit078c4bfc87bccd0c6e352192956ae8deaa5eaa86 (patch)
treefca3888eef1020f5cacccf2d41d6e1a9b91710b6
parent814b5378b4c88c3d9af3f0a38c4d15a03cae4bbf (diff)
downloadgdb-078c4bfc87bccd0c6e352192956ae8deaa5eaa86.zip
gdb-078c4bfc87bccd0c6e352192956ae8deaa5eaa86.tar.gz
gdb-078c4bfc87bccd0c6e352192956ae8deaa5eaa86.tar.bz2
2007-07-26 Michael Snyder <msnyder@access-company.com>
* aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero or count == zero.
-rw-r--r--bfd/ChangeLog3
-rw-r--r--bfd/aoutx.h9
2 files changed, 10 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d435e77..4fd7f4a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,8 @@
2007-07-26 Michael Snyder <msnyder@access-company.com>
+ * aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero
+ or count == zero.
+
* tekhex.c (first_phase): Check return value for null.
* elf.c (_bfd_elf_get_synthetic_symtab): Remove meaningless
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 92e82ae..e07d7be 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;