From 61828e55a823640870637c471bc7d62ed1e001a6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 22 Apr 2021 20:23:23 +0300 Subject: [PATCH] Fix MS-Windows link switches for unexec * configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR when linking for unexec. Reported by Nikolay Kudryavtsev . --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index d3647bdc2a2..7179fbe415f 100644 --- a/configure.ac +++ b/configure.ac @@ -5560,6 +5560,10 @@ case "$opsys" in x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x400000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;; esac + ## If they want unexec, disable Windows ASLR for the Emacs binary + if test "$with_dumping" = "unexec"; then + LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -Wl,-disable-dynamicbase -Wl,-disable-high-entropy-va -Wl,-default-image-base-low" + fi ;; *) LD_SWITCH_SYSTEM_TEMACS= ;; -- 2.39.2