2007-07-25 Michael Snyder * aoutx.h (slurp_reloc_table): Return TRUE if reloc_size == zero or count == zero. Index: aoutx.h =================================================================== RCS file: /cvs/src/src/bfd/aoutx.h,v retrieving revision 1.66 diff -p -r1.66 aoutx.h *** aoutx.h 3 Jul 2007 14:26:39 -0000 1.66 --- aoutx.h 26 Jul 2007 18:27:21 -0000 *************** NAME (aout, slurp_reloc_table) (bfd *abf *** 2280,2299 **** return FALSE; } if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) return FALSE; each_size = obj_reloc_entry_size (abfd); count = reloc_size / each_size; amt = count * sizeof (arelent); reloc_cache = bfd_zmalloc (amt); ! if (reloc_cache == NULL && count != 0) return FALSE; relocs = bfd_malloc (reloc_size); ! if (relocs == NULL && reloc_size != 0) { free (reloc_cache); return FALSE; --- 2280,2304 ---- 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) return FALSE; relocs = bfd_malloc (reloc_size); ! if (relocs == NULL) { free (reloc_cache); return FALSE;