aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-11 19:48:02 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-11 19:48:02 +0000
commit3b016d57ebe79552dbfa00642c2728bf3f5cd213 (patch)
treec183ff7b3b96540905ef3dfa9b971f9c60091b65 /gdb/coffread.c
parente9efe249805e7b4942a21d8f7de79e6136eddefa (diff)
downloadfsf-binutils-gdb-3b016d57ebe79552dbfa00642c2728bf3f5cd213.zip
fsf-binutils-gdb-3b016d57ebe79552dbfa00642c2728bf3f5cd213.tar.gz
fsf-binutils-gdb-3b016d57ebe79552dbfa00642c2728bf3f5cd213.tar.bz2
PR gdb/2280
* coffread.c (read_one_sym): Check for read errors.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index b767eaf..c492749 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1116,20 +1116,29 @@ read_one_sym (struct coff_symbol *cs,
union internal_auxent *aux)
{
int i;
+ bfd_size_type bytes;
cs->c_symnum = symnum;
- bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
+ bytes = bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
+ if (bytes != local_symesz)
+ error ("%s: error reading symbols", current_objfile->name);
bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
cs->c_naux = sym->n_numaux & 0xff;
if (cs->c_naux >= 1)
{
- bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ if (bytes != local_auxesz)
+ error ("%s: error reading symbols", current_objfile->name);
bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
0, cs->c_naux, (char *) aux);
/* If more than one aux entry, read past it (only the first aux
is important). */
for (i = 1; i < cs->c_naux; i++)
- bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ {
+ bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
+ if (bytes != local_auxesz)
+ error ("%s: error reading symbols", current_objfile->name);
+ }
}
cs->c_name = getsymname (sym);
cs->c_value = sym->n_value;