iarch = bed->arch;
imach = 0;
}
+ if (iarch == bfd_arch_unknown
+ && bfd_get_flavour (ibfd) == bfd_target_elf_flavour
+ && ibfd->target_defaulted)
+ {
+ non_fatal (_("Unable to recognise the architecture of the input file `%s'"),
+ bfd_get_archive_filename (ibfd));
+ return false;
+ }
if (!bfd_set_arch_mach (obfd, iarch, imach)
- && (ibfd->target_defaulted
- || bfd_get_arch (ibfd) != bfd_get_arch (obfd)))
+ && iarch != bfd_arch_unknown)
{
- if (bfd_get_arch (ibfd) == bfd_arch_unknown)
- non_fatal (_("Unable to recognise the format of the input file `%s'"),
- bfd_get_archive_filename (ibfd));
- else
- non_fatal (_("Output file cannot represent architecture `%s'"),
- bfd_printable_arch_mach (bfd_get_arch (ibfd),
- bfd_get_mach (ibfd)));
+ non_fatal (_("Output file cannot represent architecture `%s'"),
+ bfd_printable_arch_mach (bfd_get_arch (ibfd),
+ bfd_get_mach (ibfd)));
return false;
}