Running objdump against a 32-bit ARM PE file currently needs
disambiguation, as it gets picked up by both pei-arm-little and
pei-arm-wince-little.
This adds a check in pe_bfd_object_p so that the subsystem in the PE
header is used to do the disambiguation for us, so that WinCE images get
assigned to pei-arm-wince-little, and everything else to pei-arm-little.
#define LOCAL_LABEL_PREFIX "."
+#define WINCE
+
#include "pei-arm.c"
bfd_coff_swap_aouthdr_in (abfd, opthdr, &internal_a);
struct internal_extra_pe_aouthdr *a = &internal_a.pe;
+
+#ifdef ARM
+ /* Use Subsystem to distinguish between pei-arm-little and
+ pei-arm-wince-little. */
+#ifdef WINCE
+ if (a->Subsystem != IMAGE_SUBSYSTEM_WINDOWS_CE_GUI)
+#else
+ if (a->Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CE_GUI)
+#endif
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
+#endif
+
if ((a->SectionAlignment & -a->SectionAlignment) != a->SectionAlignment
|| a->SectionAlignment >= 0x80000000)
{