]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix MS-Windows link switches for unexec
authorEli Zaretskii <eliz@gnu.org>
Thu, 22 Apr 2021 17:23:23 +0000 (20:23 +0300)
committerEli Zaretskii <eliz@gnu.org>
Thu, 22 Apr 2021 17:23:23 +0000 (20:23 +0300)
* configure.ac (LD_SWITCH_SYSTEM_TEMACS) [mingw32]: Disable ASLR
when linking for unexec.  Reported by Nikolay Kudryavtsev
<nikolay.kudryavtsev@gmail.com>.

configure.ac

index d3647bdc2a2c1d6260f1d4a3ff7792933aca3686..7179fbe415fdb569aecb22236a8916fe4c1044e9 100644 (file)
@@ -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= ;;