+ 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
+ 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