ld: Avoid magic numbers for subsystems in pe.em and pep.em
authorMark Harmstone <mark@harmstone.com>
Tue, 24 Jan 2023 00:52:30 +0000 (00:52 +0000)
committerMark Harmstone <mark@harmstone.com>
Tue, 24 Jan 2023 00:54:45 +0000 (00:54 +0000)
ld/emultempl/pe.em
ld/emultempl/pep.em

index 0354c560fc7d9f8084444a99ac67baa34b58bb13..7e1866a23c7328a946f40a30171c0ea080256a65 100644 (file)
@@ -131,7 +131,7 @@ fragment <<EOF
                                         | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT)
 
 #if defined(TARGET_IS_i386pe) || ! defined(DLL_SUPPORT)
-#define        PE_DEF_SUBSYSTEM                3
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_CUI
 #else
 #undef NT_EXE_IMAGE_BASE
 #undef PE_DEF_SECTION_ALIGNMENT
@@ -140,13 +140,13 @@ fragment <<EOF
 
 #if defined(TARGET_IS_armpe)
 #define PE_DEF_SECTION_ALIGNMENT       0x00001000
-#define        PE_DEF_SUBSYSTEM                2
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_GUI
 #elif defined(TARGET_IS_arm_wince_pe)
 #define PE_DEF_SECTION_ALIGNMENT       0x00001000
-#define        PE_DEF_SUBSYSTEM                9
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
 #else
 #define PE_DEF_SECTION_ALIGNMENT       0x00000400
-#define        PE_DEF_SUBSYSTEM                2
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_GUI
 #endif
 #define PE_DEF_FILE_ALIGNMENT          0x00000200
 #endif
index 0bdac8f81f0d666452d7a04e6aae8511b0f26629..5a53ab3f7f2f87ee47ae4bbdb0807f82ad5adbdc 100644 (file)
@@ -131,7 +131,7 @@ fragment <<EOF
                                         | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT)
 
 #if defined(TARGET_IS_i386pep) || defined(COFF_WITH_peAArch64) || ! defined(DLL_SUPPORT)
-#define        PE_DEF_SUBSYSTEM                3
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_CUI
 #undef NT_EXE_IMAGE_BASE
 #define NT_EXE_IMAGE_BASE \
   ((bfd_vma) (${move_default_addr_high} ? 0x100400000LL \
@@ -166,7 +166,7 @@ fragment <<EOF
   ((bfd_vma) (${move_default_addr_high} ? 0x0ffff0000LL \
                                        : 0x0ffc0000LL))
 #undef  PE_DEF_SECTION_ALIGNMENT
-#define        PE_DEF_SUBSYSTEM                2
+#define        PE_DEF_SUBSYSTEM                IMAGE_SUBSYSTEM_WINDOWS_GUI
 #undef  PE_DEF_FILE_ALIGNMENT
 #define PE_DEF_FILE_ALIGNMENT          0x00000200
 #define PE_DEF_SECTION_ALIGNMENT       0x00000400