Re: [FFmpeg-devel] [PATCH 2/3 v2] configure: Support for HEASLR on mingw targets

2015-09-27 Thread Hendrik Leppkes
On Sat, Sep 26, 2015 at 8:43 AM, Alex Smith  wrote:
> From: Alex Smith 
>
> 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 
> ---
>  configure | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/configure b/configure
> index f6bc622..0a4b4ed 100755
> --- a/configure
> +++ b/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,0x14000
> +append SHFLAGS -Wl,--image-base,0x18000
>  fi
>  ;;
>  win32|win64)
> --
> 1.9.5.msysgit.0

LGTM, will push later.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3 v2] configure: Support for HEASLR on mingw targets

2015-09-26 Thread Alex Smith
From: Alex Smith 

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 
---
 configure | 4 
 1 file changed, 4 insertions(+)

diff --git a/configure b/configure
index f6bc622..0a4b4ed 100755
--- a/configure
+++ b/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,0x14000
+append SHFLAGS -Wl,--image-base,0x18000
 fi
 ;;
 win32|win64)
-- 
1.9.5.msysgit.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel