mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
* coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user