Create a huge array in bss to reserve the memory area we need for PE
binaries, to prevent exec shield from mapping system libraries there.
diff --git a/configure b/configure
index 4c8b85b..1f61966 100755
--- a/configure
+++ b/configure
@@ -12360,57 +12360,7 @@
then
LDDLL="$LDDLL,-z,defs"
fi
- echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x3c000000" >&5
-echo $ECHO_N "checking whether we can relocate the executable to 0x3c000000... $ECHO_C" >&6
-if test "${ac_cv_ld_reloc_exec+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x3c000100"
- if test "$cross_compiling" = yes; then
- ac_cv_ld_reloc_exec="no"
-else
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <unistd.h>
- int main() { return (sbrk(32*1024*1024) == (void *)-1); }
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_ld_reloc_exec="yes"
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
-ac_cv_ld_reloc_exec="no"
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
- CFLAGS="$saved_CFLAGS"
-fi
-echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
-echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6
- if test "$ac_cv_ld_reloc_exec" = "yes"
- then
- LDEXECFLAGS="-Wl,--section-start,.interp=0x3c000100"
-
- fi
echo "$as_me:$LINENO: checking whether the linker accepts --export-dynamic" >&5
echo $ECHO_N "checking whether the linker accepts --export-dynamic... $ECHO_C" >&6
if test "${ac_cv_c_export_dynamic+set}" = set; then
@@ -12460,8 +12410,65 @@
echo "${ECHO_T}$ac_cv_c_export_dynamic" >&6
if test "$ac_cv_c_export_dynamic" = "yes"
then
- LDEXECFLAGS="$LDEXECFLAGS -Wl,--export-dynamic"
+ LDEXECFLAGS="-Wl,--export-dynamic"
+
fi
+
+ case $host_cpu in
+ *i[3456789]86*)
+ echo "$as_me:$LINENO: checking whether we can relocate the executable to 0x00110000" >&5
+echo $ECHO_N "checking whether we can relocate the executable to 0x00110000... $ECHO_C" >&6
+if test "${ac_cv_ld_reloc_exec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x00110400"
+ if test "$cross_compiling" = yes; then
+ ac_cv_ld_reloc_exec="no"
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <unistd.h>
+ int main() { return (sbrk(32*1024*1024) == (void *)-1); }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_ld_reloc_exec="yes"
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_ld_reloc_exec="no"
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ CFLAGS="$saved_CFLAGS"
+fi
+echo "$as_me:$LINENO: result: $ac_cv_ld_reloc_exec" >&5
+echo "${ECHO_T}$ac_cv_ld_reloc_exec" >&6
+ if test "$ac_cv_ld_reloc_exec" = "yes"
+ then
+ LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x00110400"
+ fi
+ ;;
+ esac
+
else
echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5
echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6