aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-07-10 09:31:00 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2008-07-10 09:31:00 +0000
commit10568435e1fb17f06004b6e44fb30d05805acc04 (patch)
tree73644037047fd5460c7a58978a1d4881f899e396 /gdb/configure.ac
parent1b315056928c75e989b6a0fa858577141da5cc4f (diff)
downloadgdb-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.ac')
-rw-r--r--gdb/configure.ac23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 95d5b08..0a92812 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1268,6 +1268,29 @@ if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscal
AC_DEFINE(HAVE_TKILL_SYSCALL, 1, [Define if you support the tkill syscall.])
fi
+dnl Check if we can disable the virtual address space randomization.
+dnl The functionality of setarch -R.
+AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>])
+define([PERSONALITY_TEST], [AC_LANG_PROGRAM([#include <sys/personality.h>], [
+# 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])])
+AC_RUN_IFELSE([PERSONALITY_TEST],
+ [have_personality=true],
+ [have_personality=false],
+ [AC_LINK_IFELSE([PERSONALITY_TEST],
+ [have_personality=true],
+ [have_personality=false])])
+if $have_personality
+then
+ AC_DEFINE([HAVE_PERSONALITY], 1,
+ [Define if you support the personality syscall.])
+fi
+
dnl Handle optional features that can be enabled.
AC_ARG_WITH(sysroot,