This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] bfd/coffcode.h, (coff_set_alignment_hook): Check return of bfd_seek.


Most such calls get checked.

OK?

2011-03-07  Michael Snyder  <msnyder@vmware.com>

	* coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.

Index: coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.172
diff -u -p -r1.172 coffcode.h
--- coffcode.h	18 Jan 2011 14:13:43 -0000	1.172
+++ coffcode.h	7 Mar 2011 20:44:25 -0000
@@ -1860,12 +1860,14 @@ coff_set_alignment_hook (bfd * abfd ATTR
       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;
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]