On Mon, Sep 21, 2015 at 12:41:36AM -0400, Alex Smith wrote: > From: Alex Smith <alex.sm...@warpsharp.info> > > Binutils will always strip the relocation information from executable > files even if it needs it (dynamicbase/ASLR). We can work around this > by using the pic-executable flag combined with setting the correct entry > point since apparently ld forgets what that should be. This problem > affects both 32 and 64-bit mingw-w64. > > We can combine the nxcompat/dynamicbase check because they were added to > binutils at the same time. > > Signed-off-by: Alex Smith <alex.sm...@warpsharp.info> > > Conflicts: > configure > --- > configure | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index d2a25bb..d6ab35a 100755 > --- a/configure > +++ b/configure > @@ -4367,8 +4367,6 @@ case $target_os in > LIBTARGET=arm-wince > fi > enabled shared && ! enabled small && check_cmd $windres --version && > enable gnu_windres > - check_ldflags -Wl,--nxcompat > - check_ldflags -Wl,--dynamicbase > enabled x86_32 && check_ldflags -Wl,--large-address-aware > shlibdir_default="$bindir_default" > SLIBPREF="" > @@ -4392,6 +4390,17 @@ case $target_os in > objformat="win32" > ranlib=: > enable dos_paths > + check_ldflags -Wl,--nxcompat,--dynamicbase
> + # Lets work around some stupidity in binutils. > + # ld will strip relocations from executables even though we need them > + # for dynamicbase (ASLR). Using -pie does retain the reloc section > + # however ld then forgets what the entry point should be (oops) so we > + # have to manually (re)set it. > + if enabled x86_32; then > + add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup > + elif enabled x86_64; then > + add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup > + fi this is ugly, but ASLR is important thus applied i did not apply the nxcompat dynamicbase merge as its unrelated Thanks PS: if this breaks some version of mingw then this should be reverted [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong.
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel