[RFA] Define Elf32_auxv_t and Elf64_auxv_t if not available.

Thiago Jung Bauermann
2012-03-26T18:49:41Z

Hi,

glibc's <elf.h> says this about Elf32_auxv_t and Elf64_auxv_t:

The vector is not usually defined in a standard <elf.h> file, but it
can't hurt. We rename it to avoid conflicts.

Android's bionic libc doesn't define these types in <elf.h>. To be
honest I couldn't find a definition for auxv_t in ARM's EABI and I'm not
aware of an Android EABI document. I confirmed that bionic internally
uses this format though, and this definition seems unlikely to change.

Ok to commit? It doesn't affect compilation in i386-linux or
armv5tel-linux-gnueabi.
--
[]'s
Thiago Jung Bauermann
Linaro Toolchain Working Group

2012-03-26 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.

diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index e6e9162..6b98dc0 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -163,9 +163,10 @@ fi

AC_CHECK_DECLS([strerror, perror, memmem, vasprintf, vsnprintf])

-AC_CHECK_TYPES(socklen_t, [], [],
+AC_CHECK_TYPES([socklen_t, Elf32_auxv_t, Elf64_auxv_t], [], [],
[#include <sys/types.h>
#include <sys/socket.h>
+#include <elf.h>
])

ACX_PKGVERSION([GDB])
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index d2d4c1d..9aef4db 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -82,6 +82,34 @@