From cf3448643aec674f60f865069a4a484d5057b51f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 25 Mar 2011 17:06:52 +0000 Subject: [PATCH] * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek. --- bfd/ChangeLog | 4 ++++ bfd/coffcode.h | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d9467c8d7..b4ce01721 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2011-03-25 Michael Snyder + + * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek. + 2011-03-25 Tristan Gingold * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 5500f01e7..81478e0da 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; } -- 2.11.4.GIT