diff options
author | Jeremy Drake <cygwin@jdrake.com> | 2021-11-17 16:24:53 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-11-17 16:24:53 +0000 |
commit | ef6379e16dd164487e10a06e19bcb006d5c3788b (patch) | |
tree | b8795556248186da00e759ce1872d8e678317cf9 | |
parent | ee9e412f14908c1055cb00fab9307d1723981639 (diff) | |
download | gdb-ef6379e16dd164487e10a06e19bcb006d5c3788b.zip gdb-ef6379e16dd164487e10a06e19bcb006d5c3788b.tar.gz gdb-ef6379e16dd164487e10a06e19bcb006d5c3788b.tar.bz2 |
Set the default DLL chracteristics to 0 for Cygwin based targets.
* emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Set to 0 for
Cygwin targets.
* emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Likewise.
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 13 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 7 |
3 files changed, 23 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index d68b820..cd73230 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2021-11-17 Jeremy Drake <cygwin@jdrake.com> + + * emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Set to 0 for + Cygwin targets. + * emultempl/pep.em (DEFAULT_DLL_CHARACTERISTICS): Likewise. + 2021-11-17 Nick Clifton <nickc@redhat.com> PR 28452 diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index c5aed5f..728ad04 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -5,6 +5,16 @@ if [ -z "$MACHINE" ]; then else OUTPUT_ARCH=${ARCH}:${MACHINE} fi + +case ${target} in + *-*-cygwin*) + cygwin_behavior=1 + ;; + *) + cygwin_behavior=0; + ;; +esac + rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <<EOF @@ -104,7 +114,8 @@ fragment <<EOF #define DEFAULT_PSEUDO_RELOC_VERSION 1 #endif -#define DEFAULT_DLL_CHARACTERISTICS (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ +#define DEFAULT_DLL_CHARACTERISTICS (${cygwin_behavior} ? 0 : \ + IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) #if defined(TARGET_IS_i386pe) || ! defined(DLL_SUPPORT) diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index c6fd8b8..430351b 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -9,9 +9,11 @@ fi case ${target} in *-*-cygwin*) move_default_addr_high=1 + cygwin_behavior=1 ;; *) move_default_addr_high=0; + cygwin_behavior=0; ;; esac @@ -99,9 +101,10 @@ fragment <<EOF #define DLL_SUPPORT #endif -#define DEFAULT_DLL_CHARACTERISTICS (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ +#define DEFAULT_DLL_CHARACTERISTICS (${cygwin_behavior} ? 0 : \ + IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE \ | IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA \ - | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) + | IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) #if defined(TARGET_IS_i386pep) || ! defined(DLL_SUPPORT) #define PE_DEF_SUBSYSTEM 3 |