From: Nick Clifton Date: Fri, 15 Dec 2000 18:53:04 +0000 (+0000) Subject: Move to the start of the program headers before attempting to read them. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d20966a7346edbc65c153f55b51ccc7595e2828f;p=binutils-gdb.git Move to the start of the program headers before attempting to read them. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7eed9d29a51..99011eaf900 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2000-12-15 Miloslav Trmac + + * elfcore.h (elf_core_file_p): Move to the start of the program + headers before attempting to read them. + 2000-12-14 Kazu Hirata * peigen.c: Fix formatting. diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 11bfeac734f..f04c1d2a3b4 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);