From 8365dcf5f8c2607bb9dafb4f902653e2919a8145 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Fri, 30 Mar 2012 20:23:16 +0000 Subject: [PATCH] * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t are available. * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef. [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise. * config.in: Regenerate. * configure: Likewise. --- gdb/gdbserver/ChangeLog | 9 +++++++++ gdb/gdbserver/config.in | 6 ++++++ gdb/gdbserver/configure | 24 ++++++++++++++++++++++++ gdb/gdbserver/configure.ac | 4 ++++ gdb/gdbserver/linux-low.c | 30 ++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 63df5b08c7..cd53c66d97 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,12 @@ +2012-03-30 Thiago Jung Bauermann + + * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t + are available. + * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef. + [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise. + * config.in: Regenerate. + * configure: Likewise. + 2012-03-29 Pedro Alves * linux-low.c (regsets_store_inferior_registers) [__sparc__]: diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index 1d61c13579..912b6ae7d7 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -49,6 +49,12 @@ /* Define to 1 if you have the `dladdr' function. */ #undef HAVE_DLADDR +/* Define to 1 if the system has the type `Elf32_auxv_t'. */ +#undef HAVE_ELF32_AUXV_T + +/* Define to 1 if the system has the type `Elf64_auxv_t'. */ +#undef HAVE_ELF64_AUXV_T + /* Define if has elf_fpregset_t. */ #undef HAVE_ELF_FPREGSET_T diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 2b0aeb806b..9a6f6df8a3 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -4474,6 +4474,30 @@ _ACEOF fi +ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include + +" +if test "x$ac_cv_type_Elf32_auxv_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_ELF32_AUXV_T 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "Elf64_auxv_t" "ac_cv_type_Elf64_auxv_t" "#include + +" +if test "x$ac_cv_type_Elf64_auxv_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_ELF64_AUXV_T 1 +_ACEOF + + +fi + + # Check whether --with-pkgversion was given. diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index d2f22bd62a..9ac4232f0d 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -168,6 +168,10 @@ AC_CHECK_TYPES(socklen_t, [], [], #include ]) +AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [], +#include +) + ACX_PKGVERSION([GDB]) ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description]) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index ab875704ea..043451d857 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -82,6 +82,36 @@ #endif #endif +#ifndef HAVE_ELF32_AUXV_T +/* Copied from glibc's elf.h. */ +typedef struct +{ + uint32_t a_type; /* Entry type */ + union + { + uint32_t a_val; /* Integer value */ + /* We use to have pointer elements added here. We cannot do that, + though, since it does not work when using 32-bit definitions + on 64-bit platforms and vice versa. */ + } a_un; +} Elf32_auxv_t; +#endif + +#ifndef HAVE_ELF64_AUXV_T +/* Copied from glibc's elf.h. */ +typedef struct +{ + uint64_t a_type; /* Entry type */ + union + { + uint64_t a_val; /* Integer value */ + /* We use to have pointer elements added here. We cannot do that, + though, since it does not work when using 32-bit definitions + on 64-bit platforms and vice versa. */ + } a_un; +} Elf64_auxv_t; +#endif + /* ``all_threads'' is keyed by the LWP ID, which we use as the GDB protocol representation of the thread ID. -- 2.34.1