- && i_ehdrp->e_ident[EI_OSABI] != ebd->elf_osabi)
- {
- if (ebd->elf_osabi != ELFOSABI_NONE)
- goto got_wrong_format_error;
-
- /* This is an ELFOSABI_NONE ELF target. Let it match any ELF
- target of the compatible machine for which we do not have a
- backend with matching ELFOSABI. */
- for (target_ptr = bfd_target_vector;
- *target_ptr != NULL;
- target_ptr++)
- {
- const struct elf_backend_data *back;
-
- /* Skip this target and targets with incompatible byte
- order. */
- if (*target_ptr == target
- || (*target_ptr)->flavour != bfd_target_elf_flavour
- || (*target_ptr)->byteorder != target->byteorder
- || ((*target_ptr)->header_byteorder
- != target->header_byteorder))
- continue;
-
- back = xvec_get_elf_backend_data (*target_ptr);
- if (back->elf_osabi == i_ehdrp->e_ident[EI_OSABI]
- && (back->elf_machine_code == i_ehdrp->e_machine
- || (back->elf_machine_alt1 != 0
- && back->elf_machine_alt1 == i_ehdrp->e_machine)
- || (back->elf_machine_alt2 != 0
- && back->elf_machine_alt2 == i_ehdrp->e_machine)))
- {
- /* target_ptr is an ELF backend which matches this
- object file, so reject the ELFOSABI_NONE ELF target. */
- goto got_wrong_format_error;
- }
- }
- }