summaryrefslogtreecommitdiff
path: root/bfd/elfcore.h
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-01-27 23:27:23 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-01-27 23:27:23 +0000
commit114d31c1c05ab6d407a86530abc6abf161040176 (patch)
tree84b673d0c90a8d9b78118ea27c25738e8aa9650a /bfd/elfcore.h
parent9187474f374aea7adcb8f3349cc30881fd2df524 (diff)
downloadbinutils-redhat-114d31c1c05ab6d407a86530abc6abf161040176.tar.gz
* elfcore.h (elf_core_file_p): Set the machine architecture
before processing the program headers.
Diffstat (limited to 'bfd/elfcore.h')
-rw-r--r--bfd/elfcore.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 2a795a9c8b..5c818120a0 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -220,13 +220,6 @@ elf_core_file_p (abfd)
elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex);
}
- /* Process each program header. */
- for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
- {
- if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
- goto fail;
- }
-
/* Set the machine architecture. */
if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
{
@@ -235,6 +228,13 @@ elf_core_file_p (abfd)
goto fail;
}
+ /* Process each program header. */
+ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
+ {
+ if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex))
+ goto fail;
+ }
+
/* Save the entry point from the ELF header. */
bfd_get_start_address (abfd) = i_ehdrp->e_entry;