Set the machine architecture in the bfd structure before
parsing the program headers.
This commit is contained in:
parent
5f64c7fa5a
commit
872ed866f5
14
gnu/dist/toolchain/bfd/elfcore.h
vendored
14
gnu/dist/toolchain/bfd/elfcore.h
vendored
@ -203,13 +203,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_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Set the machine architecture. */
|
||||
if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
|
||||
{
|
||||
@ -218,6 +211,13 @@ elf_core_file_p (abfd)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Process each program header. */
|
||||
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
||||
{
|
||||
if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Save the entry point from the ELF header. */
|
||||
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user