Skip to content
Permalink
Browse files

configure: Support for HEASLR on mingw targets

The appropriate flag for HEASLR (--high-entropy-va) was added in
binutils 2.25.

Also set the image base >4GB so higher entropy gets applied to image
base randomization when used with HEASLR (8 -> 17 bits of
randomization).  Windows does this for compatibility because of "latent
pointer truncation issues".

Signed-off-by: Alex Smith <alex.smith@warpsharp.info>
  • Loading branch information
TheRyuu committed Sep 26, 2015
1 parent f559812 commit f2b805d02ee12af5593130ef06f0924422e8622e
Showing with 4 additions and 0 deletions.
  1. +4 −0 configure
@@ -4401,6 +4401,10 @@ case $target_os in
add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
elif enabled x86_64; then
add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
check_ldflags -Wl,--high-entropy-va # binutils 2.25
# Set image base >4GB for extra entropy with HEASLR
add_ldexeflags -Wl,--image-base,0x140000000
append SHFLAGS -Wl,--image-base,0x180000000
fi
;;
win32|win64)

0 comments on commit f2b805d

Please sign in to comment.