diff options
-rw-r--r-- | bfd/pei-arm-wince.c | 2 | ||||
-rw-r--r-- | bfd/peicode.h | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/bfd/pei-arm-wince.c b/bfd/pei-arm-wince.c index 6391dd5..914ee0b 100644 --- a/bfd/pei-arm-wince.c +++ b/bfd/pei-arm-wince.c @@ -28,4 +28,6 @@ #define LOCAL_LABEL_PREFIX "." +#define WINCE + #include "pei-arm.c" diff --git a/bfd/peicode.h b/bfd/peicode.h index 68ec3a3..22ffec9 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -1528,6 +1528,21 @@ pe_bfd_object_p (bfd * abfd) 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) { |