diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2008-07-10 09:31:00 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2008-07-10 09:31:00 +0000 |
commit | 10568435e1fb17f06004b6e44fb30d05805acc04 (patch) | |
tree | 73644037047fd5460c7a58978a1d4881f899e396 /gdb/configure | |
parent | 1b315056928c75e989b6a0fa858577141da5cc4f (diff) | |
download | gdb-10568435e1fb17f06004b6e44fb30d05805acc04.zip gdb-10568435e1fb17f06004b6e44fb30d05805acc04.tar.gz gdb-10568435e1fb17f06004b6e44fb30d05805acc04.tar.bz2 |
gdb/
* NEWS (New commands): Mention "set disable-randomization".
* configure.ac: Add check for HAVE_PERSONALITY and
HAVE_DECL_ADDR_NO_RANDOMIZE.
* configure, config.in: Regenerate.
* linux-nat.c [HAVE_PERSONALITY]: New include <sys/personality.h>.
[HAVE_PERSONALITY] [!HAVE_DECL_ADDR_NO_RANDOMIZE]: Set
ADDR_NO_RANDOMIZE.
(disable_randomization, show_disable_randomization)
(set_disable_randomization): New.
(linux_nat_create_inferior) [HAVE_PERSONALITY]: New variables
PERSONALITY_ORIG and PERSONALITY_SET. Disable randomization upon the
variable DISABLE_RANDOMIZATION.
(_initialize_linux_nat): Call ADD_SETSHOW_BOOLEAN_CMD for the variable
DISABLE_RANDOMIZATION.
gdb/doc/
* gdb.texinfo (Starting): Document "set disable-randomization".
gdb/testsuite/
* gdb.base/randomize.exp, gdb.base/randomize.c: New files.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-x | gdb/configure | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/gdb/configure b/gdb/configure index b97dd73f..e555e25 100755 --- a/gdb/configure +++ b/gdb/configure @@ -23669,6 +23669,188 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether ADDR_NO_RANDOMIZE is declared" >&5 +echo $ECHO_N "checking whether ADDR_NO_RANDOMIZE is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_ADDR_NO_RANDOMIZE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/personality.h> + +int +main () +{ +#ifndef ADDR_NO_RANDOMIZE + char *p = (char *) ADDR_NO_RANDOMIZE; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { ac_try='test -s conftest.$ac_objext' + { (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_have_decl_ADDR_NO_RANDOMIZE=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_ADDR_NO_RANDOMIZE=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_ADDR_NO_RANDOMIZE" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ADDR_NO_RANDOMIZE" >&6 +if test $ac_cv_have_decl_ADDR_NO_RANDOMIZE = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ADDR_NO_RANDOMIZE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ADDR_NO_RANDOMIZE 0 +_ACEOF + + +fi + + + +if test "$cross_compiling" = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/personality.h> +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (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); }; } && + { ac_try='test -s 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 + have_personality=true +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +have_personality=false +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/personality.h> +int +main () +{ + +# if !HAVE_DECL_ADDR_NO_RANDOMIZE +# define ADDR_NO_RANDOMIZE 0x0040000 +# endif + /* Test the flag could be set and stays set. */ + personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); + if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) + return 1 + ; + return 0; +} +_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 + have_personality=true +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 ) +have_personality=false +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +if $have_personality +then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PERSONALITY 1 +_ACEOF + +fi + # Check whether --with-sysroot or --without-sysroot was given. |