[PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI

Nick Clifton nickc@redhat.com
Mon Jan 23 10:59:46 GMT 2023


Hi Mark,

> This fixes the test failures introduced by 87a5cf5c, by changing the
> default subsystem for arm-pe from 9 (IMAGE_SUBSYSTEM_WINDOWS_CE_GUI) to
> 2 (IMAGE_SUBSYSTEM_WINDOWS_GUI), which matches what happens with other
> PE targets.

Approved - please apply - but ...

> -#if defined(TARGET_IS_armpe) || defined(TARGET_IS_arm_wince_pe)
> +#if defined(TARGET_IS_armpe)
> +#define PE_DEF_SECTION_ALIGNMENT	0x00001000
> +#define	PE_DEF_SUBSYSTEM		2
> +#elif defined(TARGET_IS_arm_wince_pe)
>   #define PE_DEF_SECTION_ALIGNMENT	0x00001000
>   #define	PE_DEF_SUBSYSTEM		9
>   #else

I really dislike magic numbers.  Given that coff/pe.h has been included
at this point, why not use IMAGE_SUBSYSTEM_... instead of 2 and 9 ?

A separate patch that does this for both pe.em and pep.em is pre-approved,
should you feel motivated to do so.

Cheers
   Nick



More information about the Binutils mailing list