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)
/* Allocate space for the program headers. */
amt = sizeof (*i_phdrp) * i_ehdrp->e_phnum;
- i_phdrp = bfd_alloc (abfd, amt);
+ i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
if (!i_phdrp)
goto fail;