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

James Almer jamrial at gmail.com
Wed Sep 23 02:02:37 CEST 2015


On 9/21/2015 1:41 AM, Alex Smith wrote:
> From: Alex Smith <alex.smith at warpsharp.info>
> 
> The appropriate flag for HEASLR (--high-entropy-va) is scheduled for
> inclusion in the next version of binutils (2.25), doesn't hurt to
> include it a little early.

2.25 has been out for a while, so i think this commit message should be
updated to reflect that.

No comments on the actual patch, so wait for someone else.

> 
> 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 at warpsharp.info>
> ---
>  configure | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/configure b/configure
> index d6ab35a..0c60c03 100755
> --- a/configure
> +++ b/configure
> @@ -4400,6 +4400,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)
> 



More information about the ffmpeg-devel mailing list