* [PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI
@ 2023-01-22 23:57 Mark Harmstone
2023-01-23 10:59 ` Nick Clifton
0 siblings, 1 reply; 3+ messages in thread
From: Mark Harmstone @ 2023-01-22 23:57 UTC (permalink / raw)
To: binutils, amodra; +Cc: Mark Harmstone
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.
As far as I can tell there's no working modern Windows CE toolchain
knocking about anyway, so this change shouldn't inconvenience anyone.
---
ld/emultempl/pe.em | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 0413d07d6c3..0354c560fc7 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -138,7 +138,10 @@ fragment <<EOF
#undef PE_DEF_FILE_ALIGNMENT
#define NT_EXE_IMAGE_BASE 0x00010000
-#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
--
2.38.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI
2023-01-22 23:57 [PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI Mark Harmstone
@ 2023-01-23 10:59 ` Nick Clifton
2023-01-23 20:29 ` Mark Harmstone
0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2023-01-23 10:59 UTC (permalink / raw)
To: Mark Harmstone, binutils, amodra
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI
2023-01-23 10:59 ` Nick Clifton
@ 2023-01-23 20:29 ` Mark Harmstone
0 siblings, 0 replies; 3+ messages in thread
From: Mark Harmstone @ 2023-01-23 20:29 UTC (permalink / raw)
To: Nick Clifton, binutils
Thanks Nick.
> 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.
I agree - I will do.
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-23 20:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-22 23:57 [PATCH] ld: Set default subsystem for arm-pe to IMAGE_SUBSYSTEM_WINDOWS_GUI Mark Harmstone
2023-01-23 10:59 ` Nick Clifton
2023-01-23 20:29 ` Mark Harmstone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).