aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-03-25 17:06:53 +0000
committerNick Clifton <nickc@redhat.com>2011-03-25 17:06:53 +0000
commitb42adabf1ef3955e838f78bf4575070b73d7b4ae (patch)
treedce21cef7f659e7fad75566a2c0e02736e646509 /bfd/coffcode.h
parentd0f0b69d106989973b8924276a7c48f75b716258 (diff)
downloadgdb-b42adabf1ef3955e838f78bf4575070b73d7b4ae.zip
gdb-b42adabf1ef3955e838f78bf4575070b73d7b4ae.tar.gz
gdb-b42adabf1ef3955e838f78bf4575070b73d7b4ae.tar.bz2
* coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 5500f01..81478e0 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1856,16 +1856,18 @@ coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED,
if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL)
{
struct external_reloc dst;
- struct internal_reloc n;
+ struct internal_reloc an;
file_ptr oldpos = bfd_tell (abfd);
bfd_size_type relsz = bfd_coff_relsz (abfd);
- bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0);
+ if (bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0) != 0)
+ return;
if (bfd_bread (& dst, relsz, abfd) != relsz)
return;
coff_swap_reloc_in (abfd, &dst, &n);
- bfd_seek (abfd, oldpos, 0);
+ if (bfd_seek (abfd, oldpos, 0) != 0)
+ return;
section->reloc_count = hdr->s_nreloc = n.r_vaddr - 1;
section->rel_filepos += relsz;
}