2007-07-04 H.J. Lu <hongjiu.lu@intel.com>
* peicode.h (pe_bfd_object_p): Don't check PE vs. EFI target if arch is unknown.
This commit is contained in:
parent
e4e4a5d1f4
commit
a93221e521
|
@ -1,3 +1,8 @@
|
||||||
|
2007-07-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* peicode.h (pe_bfd_object_p): Don't check PE vs. EFI target
|
||||||
|
if arch is unknown.
|
||||||
|
|
||||||
2007-07-04 Nick Clifton <nickc@redhat.com>
|
2007-07-04 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
Import this patch from an internal tree:
|
Import this patch from an internal tree:
|
||||||
|
|
|
@ -1342,6 +1342,10 @@ pe_bfd_object_p (bfd * abfd)
|
||||||
else
|
else
|
||||||
arch = pe_arch (bfd_target_pei_arch (abfd->xvec));
|
arch = pe_arch (bfd_target_pei_arch (abfd->xvec));
|
||||||
|
|
||||||
|
/* Don't check PE vs. EFI if arch is unknown. */
|
||||||
|
if (arch == arch_type_unknown)
|
||||||
|
return target;
|
||||||
|
|
||||||
for (target_ptr = bfd_target_vector; *target_ptr != NULL;
|
for (target_ptr = bfd_target_vector; *target_ptr != NULL;
|
||||||
target_ptr++)
|
target_ptr++)
|
||||||
{
|
{
|
||||||
|
@ -1355,13 +1359,13 @@ pe_bfd_object_p (bfd * abfd)
|
||||||
if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
|
if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (efi)
|
if (efi)
|
||||||
{
|
{
|
||||||
/* TARGET_PTR is an EFI backend. Don't match
|
/* TARGET_PTR is an EFI backend. Don't match
|
||||||
TARGET with a EFI file. */
|
TARGET with a EFI file. */
|
||||||
bfd_set_error (bfd_error_wrong_format);
|
bfd_set_error (bfd_error_wrong_format);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (bfd_target_pei_p (*target_ptr))
|
else if (bfd_target_pei_p (*target_ptr))
|
||||||
{
|
{
|
||||||
|
@ -1369,13 +1373,13 @@ pe_bfd_object_p (bfd * abfd)
|
||||||
if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
|
if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!efi)
|
if (!efi)
|
||||||
{
|
{
|
||||||
/* TARGET_PTR is a PE backend. Don't match
|
/* TARGET_PTR is a PE backend. Don't match
|
||||||
TARGET with a PE file. */
|
TARGET with a PE file. */
|
||||||
bfd_set_error (bfd_error_wrong_format);
|
bfd_set_error (bfd_error_wrong_format);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue