2007-07-26 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 26 Jul 2007 18:30:28 +0000 (18:30 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 26 Jul 2007 18:30:28 +0000 (18:30 +0000)
* aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero
or count == zero.

bfd/ChangeLog
bfd/aoutx.h

index d435e77d22dec3e80571c198a59092ceb79305e7..4fd7f4aa3b682bc3f1abdff7f768a98f4a480df3 100644 (file)
@@ -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 
index 92e82ae346618ef181876c66237a6a1ce6bf6a05..e07d7bef39f24af21d1cde640dcd0d07b00885f9 100644 (file)
@@ -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;
This page took 0.0290859999999999 seconds and 4 git commands to generate.