diff options
-rw-r--r-- | ld/emultempl/pe.em | 13 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 19 | ||||
-rw-r--r-- | ld/ld.texi | 11 |
3 files changed, 25 insertions, 18 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 9a2b576..50bb082 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -7,11 +7,11 @@ else fi case ${target} in - *-*-cygwin*) - cygwin_behavior=1 + *-*-mingw*) + mingw_behavior=1 ;; *) - cygwin_behavior=0; + mingw_behavior=0 ;; esac @@ -126,9 +126,10 @@ fragment <<EOF #define DEFAULT_PSEUDO_RELOC_VERSION 1 #endif -#define DEFAULT_DLL_CHARACTERISTICS (${cygwin_behavior} ? 0 : \ - IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ - | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) +#define DEFAULT_DLL_CHARACTERISTICS (${mingw_behavior} \ + ? IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ + | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT \ + : 0) #if defined(TARGET_IS_i386pe) || ! defined(DLL_SUPPORT) #define PE_DEF_SUBSYSTEM IMAGE_SUBSYSTEM_WINDOWS_CUI diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 440c0bf..60a8339 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -9,11 +9,15 @@ fi case ${target} in *-*-cygwin*) move_default_addr_high=1 - cygwin_behavior=1 + mingw_behavior=0 + ;; + *-*-mingw*) + move_default_addr_high=0 + mingw_behavior=1 ;; *) - move_default_addr_high=0; - cygwin_behavior=0; + move_default_addr_high=0 + mingw_behavior=0 ;; esac @@ -126,10 +130,11 @@ fragment <<EOF #define DLL_SUPPORT #endif -#define DEFAULT_DLL_CHARACTERISTICS (${cygwin_behavior} ? 0 : \ - IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ - | IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA \ - | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) +#define DEFAULT_DLL_CHARACTERISTICS (${mingw_behavior} \ + ? IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ + | IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA \ + | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT \ + : 0) #if defined(TARGET_IS_i386pep) || defined(COFF_WITH_peAArch64) || ! defined(DLL_SUPPORT) #define PE_DEF_SUBSYSTEM IMAGE_SUBSYSTEM_WINDOWS_CUI @@ -3781,7 +3781,8 @@ of the PE file header: @item --high-entropy-va @itemx --disable-high-entropy-va Image is compatible with 64-bit address space layout randomization -(ASLR). This option is enabled by default for 64-bit PE images. +(ASLR). This option is enabled by default for 64-bit PE images in +MinGW targets. This option also implies @option{--dynamicbase} and @option{--enable-reloc-section}. @@ -3791,9 +3792,9 @@ This option also implies @option{--dynamicbase} and @itemx --disable-dynamicbase The image base address may be relocated using address space layout randomization (ASLR). This feature was introduced with MS Windows -Vista for i386 PE targets. This option is enabled by default but -can be disabled via the @option{--disable-dynamicbase} option. -This option also implies @option{--enable-reloc-section}. +Vista for i386 PE targets. This option is enabled by default for MinGW +targets but can be disabled via the @option{--disable-dynamicbase} +option. This option also implies @option{--enable-reloc-section}. @kindex --forceinteg @item --forceinteg @@ -3806,7 +3807,7 @@ default. @item --disable-nxcompat The image is compatible with the Data Execution Prevention. This feature was introduced with MS Windows XP SP2 for i386 PE -targets. The option is enabled by default. +targets. The option is enabled by default for MinGW targets. @kindex --no-isolation @item --no-isolation |