diff options
author | Nick Clifton <nickc@redhat.com> | 2000-12-15 18:53:04 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-12-15 18:53:04 +0000 |
commit | d20966a7346edbc65c153f55b51ccc7595e2828f (patch) | |
tree | a90e51bbbaa4fb8b0db720979c91f1b0080cc7af /bfd/elfcore.h | |
parent | 2649061d5986e38ac2bac5e771b4ed26fa6cacca (diff) | |
download | binutils-d20966a7346edbc65c153f55b51ccc7595e2828f.zip binutils-d20966a7346edbc65c153f55b51ccc7595e2828f.tar.gz binutils-d20966a7346edbc65c153f55b51ccc7595e2828f.tar.bz2 |
Move to the start of the program headers before attempting to read them.
Diffstat (limited to 'bfd/elfcore.h')
-rw-r--r-- | bfd/elfcore.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 11bfeac..f04c1d2 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -182,6 +182,10 @@ elf_core_file_p (abfd) if (i_ehdrp->e_phentsize != sizeof (Elf_External_Phdr)) goto wrong; + /* Move to the start of the program headers. */ + if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0) + goto wrong; + /* Allocate space for the program headers. */ i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum); |