aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorThiago Jung Bauermann <bauerman@br.ibm.com>2012-03-30 20:23:16 +0000
committerThiago Jung Bauermann <bauerman@br.ibm.com>2012-03-30 20:23:16 +0000
commit8365dcf5f8c2607bb9dafb4f902653e2919a8145 (patch)
treed0918443c582084f8a3f1b5e534524e4593d6448 /gdb/gdbserver
parent9bc3523d11081b973ad34f212cb5cacf3126a27f (diff)
downloadgdb-8365dcf5f8c2607bb9dafb4f902653e2919a8145.zip
gdb-8365dcf5f8c2607bb9dafb4f902653e2919a8145.tar.gz
gdb-8365dcf5f8c2607bb9dafb4f902653e2919a8145.tar.bz2
* 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.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog9
-rw-r--r--gdb/gdbserver/config.in6
-rwxr-xr-xgdb/gdbserver/configure24
-rw-r--r--gdb/gdbserver/configure.ac4
-rw-r--r--gdb/gdbserver/linux-low.c30
5 files changed, 73 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 63df5b0..cd53c66 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-30 Thiago Jung Bauermann <thiago.bauermann@linaro.org>
+
+ * 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 <palves@redhat.com>
* linux-low.c (regsets_store_inferior_registers) [__sparc__]:
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 1d61c13..912b6ae 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 <sys/procfs.h> has elf_fpregset_t. */
#undef HAVE_ELF_FPREGSET_T
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 2b0aeb8..9a6f6df 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 <elf.h>
+
+"
+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 <elf.h>
+
+"
+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 d2f22bd..9ac4232 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -168,6 +168,10 @@ AC_CHECK_TYPES(socklen_t, [], [],
#include <sys/socket.h>
])
+AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [],
+#include <elf.h>
+)
+
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 ab87570..043451d 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.