mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
Revert "Revert "Fix fbsd core matching""
This reverts commit 476288fa2bddecf0f0e13dee826a076309bf01fe.
This commit is contained in:
@ -149,37 +149,14 @@ elf_core_file_p (bfd *abfd)
|
|||||||
&& (ebd->elf_machine_alt1 == 0
|
&& (ebd->elf_machine_alt1 == 0
|
||||||
|| i_ehdrp->e_machine != ebd->elf_machine_alt1)
|
|| i_ehdrp->e_machine != ebd->elf_machine_alt1)
|
||||||
&& (ebd->elf_machine_alt2 == 0
|
&& (ebd->elf_machine_alt2 == 0
|
||||||
|| i_ehdrp->e_machine != ebd->elf_machine_alt2))
|
|| i_ehdrp->e_machine != ebd->elf_machine_alt2)
|
||||||
{
|
&& ebd->elf_machine_code != EM_NONE)
|
||||||
const bfd_target * const *target_ptr;
|
goto wrong;
|
||||||
|
|
||||||
if (ebd->elf_machine_code != EM_NONE)
|
if (ebd->elf_machine_code != EM_NONE
|
||||||
goto wrong;
|
&& i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi
|
||||||
|
&& ebd->elf_osabi != ELFOSABI_NONE)
|
||||||
/* This is the generic ELF target. Let it match any ELF target
|
goto wrong;
|
||||||
for which we do not have a specific backend. */
|
|
||||||
|
|
||||||
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
|
|
||||||
{
|
|
||||||
const struct elf_backend_data *back;
|
|
||||||
|
|
||||||
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
|
|
||||||
continue;
|
|
||||||
back = xvec_get_elf_backend_data (*target_ptr);
|
|
||||||
if (back->s->arch_size != ARCH_SIZE)
|
|
||||||
continue;
|
|
||||||
if (back->elf_machine_code == i_ehdrp->e_machine
|
|
||||||
|| (back->elf_machine_alt1 != 0
|
|
||||||
&& i_ehdrp->e_machine == back->elf_machine_alt1)
|
|
||||||
|| (back->elf_machine_alt2 != 0
|
|
||||||
&& i_ehdrp->e_machine == back->elf_machine_alt2))
|
|
||||||
{
|
|
||||||
/* target_ptr is an ELF backend which matches this
|
|
||||||
object file, so reject the generic ELF target. */
|
|
||||||
goto wrong;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If there is no program header, or the type is not a core file, then
|
/* If there is no program header, or the type is not a core file, then
|
||||||
we are hosed. */
|
we are hosed. */
|
||||||
@ -199,6 +176,9 @@ elf_core_file_p (bfd *abfd)
|
|||||||
Elf_Internal_Shdr i_shdr;
|
Elf_Internal_Shdr i_shdr;
|
||||||
file_ptr where = (file_ptr) i_ehdrp->e_shoff;
|
file_ptr where = (file_ptr) i_ehdrp->e_shoff;
|
||||||
|
|
||||||
|
if (i_ehdrp->e_shoff < sizeof (x_ehdr))
|
||||||
|
goto wrong;
|
||||||
|
|
||||||
/* Seek to the section header table in the file. */
|
/* Seek to the section header table in the file. */
|
||||||
if (bfd_seek (abfd, where, SEEK_SET) != 0)
|
if (bfd_seek (abfd, where, SEEK_SET) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Reference in New Issue
Block a user