diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-04-04 22:49:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-04-04 22:49:04 +0000 |
commit | 4002f18a05ecf53961c0e3b25a6d835576239fab (patch) | |
tree | f1418405276000a7a2eec3c0c95722c53bb9ca96 /bfd/hp300hpux.c | |
parent | 6d4f771502a396883f5e201165512effd6c808b6 (diff) | |
download | gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.zip gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.gz gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.bz2 |
Made sure that every call to bfd_read, bfd_write, and bfd_seek
checks the return value and handled bfd_error correctly. These
changes are not itemised.
Diffstat (limited to 'bfd/hp300hpux.c')
-rw-r--r-- | bfd/hp300hpux.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c index d73ab1a..3b8cb9c 100644 --- a/bfd/hp300hpux.c +++ b/bfd/hp300hpux.c @@ -283,8 +283,10 @@ MY (write_object_contents) (abfd) /* this is really the sym table size but we store it in drelocs */ bfd_h_put_32 (abfd, bfd_get_symcount (abfd) * 12, exec_bytes.e_drelocs); - bfd_seek (abfd, 0L, false); - bfd_write ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd); + if (bfd_seek (abfd, 0L, false) != 0 + || (bfd_write ((PTR) & exec_bytes, 1, EXEC_BYTES_SIZE, abfd) + != EXEC_BYTES_SIZE)) + return false; /* Write out the symbols, and then the relocs. We must write out the symbols first so that we know the symbol indices. */ @@ -302,12 +304,12 @@ MY (write_object_contents) (abfd) if (bfd_get_symcount (abfd) != 0) { - bfd_seek (abfd, (long) (N_TRELOFF (*execp)), false); - + if (bfd_seek (abfd, (long) (N_TRELOFF (*execp)), false) != 0) + return false; if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) return false; - bfd_seek (abfd, (long) (N_DRELOFF (*execp)), false); - + if (bfd_seek (abfd, (long) (N_DRELOFF (*execp)), false) != 0) + return false; if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) return false; } @@ -503,8 +505,8 @@ MY (slurp_symbol_table) (abfd) return false; } syms = (struct external_nlist *) (strings + SYM_EXTRA_BYTES); - bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET); - if (bfd_read ((PTR) syms, symbol_bytes, 1, abfd) != symbol_bytes) + if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 + || bfd_read ((PTR) syms, symbol_bytes, 1, abfd) != symbol_bytes) { bfd_release (abfd, syms); return false; @@ -739,7 +741,8 @@ MY (slurp_reloc_table) (abfd, asect, symbols) return false; doit: - bfd_seek (abfd, asect->rel_filepos, SEEK_SET); + if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) + return false; each_size = obj_reloc_entry_size (abfd); count = reloc_size / each_size; |