+2021-05-08 Pedro Alves <pedro@palves.net>
+
+ * linux-nat.c (linux_nat_target::supports_disable_randomization):
+ Remove references to HAVE_PERSONALITY.
+ * nat/linux-personality.c: Remove references to HAVE_PERSONALITY.
+ (maybe_disable_address_space_randomization)
+ (~maybe_disable_address_space_randomizatio): Remove references to
+ HAVE_PERSONALITY.
+ * config.in, configure: Regenerate.
+
2021-05-07 Andrew Burgess <andrew.burgess@embecosm.com>
* cli/cli-cmds.c: Add 'gdbsupport/gdb_tilde_expand.h'
/* define if the compiler supports basic C++11 syntax */
#undef HAVE_CXX11
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
- you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
don't. */
#undef HAVE_DECL_ASPRINTF
/* Define to 1 if you have the <nlist.h> header file. */
#undef HAVE_NLIST_H
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
/* Define to 1 if you have the `pipe' function. */
#undef HAVE_PIPE
done
- ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include <sys/personality.h>
-"
-if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl
-_ACEOF
-
-
- if test "$cross_compiling" = yes; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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
-if ac_fn_c_try_link "$LINENO"; then :
- have_personality=true
-else
- have_personality=false
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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
-if ac_fn_c_try_run "$LINENO"; then :
- have_personality=true
-else
- have_personality=false
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- if $have_personality
- then
-
-$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h
-
- fi
-
ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
if test "x$ac_cv_have_decl_strstr" = xyes; then :
ac_have_decl=1
bool
linux_nat_target::supports_disable_randomization ()
{
-#ifdef HAVE_PERSONALITY
return true;
-#else
- return false;
-#endif
}
/* SIGCHLD handler that serves two purposes: In non-stop/async mode,
#include "gdbsupport/common-defs.h"
#include "nat/linux-personality.h"
-#ifdef HAVE_PERSONALITY
-# include <sys/personality.h>
-# if !HAVE_DECL_ADDR_NO_RANDOMIZE
-# define ADDR_NO_RANDOMIZE 0x0040000
-# endif /* ! HAVE_DECL_ADDR_NO_RANDOMIZE */
-#endif /* HAVE_PERSONALITY */
+#include <sys/personality.h>
/* See comment on nat/linux-personality.h. */
: m_personality_set (false),
m_personality_orig (0)
{
-#ifdef HAVE_PERSONALITY
if (disable_randomization)
{
errno = 0;
warning (_("Error disabling address space randomization: %s"),
safe_strerror (errno));
}
-#endif /* HAVE_PERSONALITY */
}
maybe_disable_address_space_randomization::
~maybe_disable_address_space_randomization ()
{
-#ifdef HAVE_PERSONALITY
-
if (m_personality_set)
{
errno = 0;
warning (_("Error restoring address space randomization: %s"),
safe_strerror (errno));
}
-#endif /* HAVE_PERSONALITY */
}
+2021-05-08 Pedro Alves <pedro@palves.net>
+
+ * linux-low.cc:
+ (linux_process_target::supports_disable_randomization): Remove
+ reference to HAVE_PERSONALITY.
+ * config.in, configure: Regenerate.
+
2021-05-08 Pedro Alves <pedro@palves.net>
* linux-low.cc: Don't include sys/personality.h or define
/* define if the compiler supports basic C++11 syntax */
#undef HAVE_CXX11
-/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if
- you don't. */
-#undef HAVE_DECL_ADDR_NO_RANDOMIZE
-
/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
don't. */
#undef HAVE_DECL_ASPRINTF
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#undef HAVE_NETINET_TCP_H
-/* Define if you support the personality syscall. */
-#undef HAVE_PERSONALITY
-
/* Define to 1 if you have the `pipe' function. */
#undef HAVE_PIPE
done
- ac_fn_c_check_decl "$LINENO" "ADDR_NO_RANDOMIZE" "ac_cv_have_decl_ADDR_NO_RANDOMIZE" "#include <sys/personality.h>
-"
-if test "x$ac_cv_have_decl_ADDR_NO_RANDOMIZE" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ADDR_NO_RANDOMIZE $ac_have_decl
-_ACEOF
-
-
- if test "$cross_compiling" = yes; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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
-if ac_fn_c_try_link "$LINENO"; then :
- have_personality=true
-else
- have_personality=false
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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
-if ac_fn_c_try_run "$LINENO"; then :
- have_personality=true
-else
- have_personality=false
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- if $have_personality
- then
-
-$as_echo "#define HAVE_PERSONALITY 1" >>confdefs.h
-
- fi
-
ac_fn_c_check_decl "$LINENO" "strstr" "ac_cv_have_decl_strstr" "$ac_includes_default"
if test "x$ac_cv_have_decl_strstr" = xyes; then :
ac_have_decl=1
bool
linux_process_target::supports_disable_randomization ()
{
-#ifdef HAVE_PERSONALITY
return true;
-#else
- return false;
-#endif
}
bool
+2021-05-08 Pedro Alves <pedro@palves.net>
+
+ * common.m4 (personality test): Remove.
+
2021-04-30 Tom Tromey <tromey@adacore.com>
* thread-pool.cc (thread_pool::post_task): Update.
ptrace64 sbrk setns sigaltstack sigprocmask \
setpgid setpgrp getrusage getauxval])
- 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
-
AC_CHECK_DECLS([strstr])
# ----------------------- #