From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11140 invoked by alias); 26 Mar 2012 18:49:41 -0000 Received: (qmail 11023 invoked by uid 22791); 26 Mar 2012 18:49:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_WEB X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Mar 2012 18:49:27 +0000 Received: by ggeq1 with SMTP id q1so4837991gge.0 for ; Mon, 26 Mar 2012 11:49:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:date:organization:content-type:x-mailer :content-transfer-encoding:mime-version:x-gm-message-state; bh=bP9KO9L2t8o4LwJSagVAFDIGPwyPNkaZ/ljXgfw/RSU=; b=MMR+iMcEQ2piuFV+29RVTMDAyAAvksYDfqggbithwU/Bv7MX18/hovNd8YD7spax4H X/obQpr0J5kn9duMQwQ02ZOO8G308xD5b/PpUP1h9OO8FfUTCp6ExSbHejzp4QE2DSPA QyP2+kSh5Ciu3ZiI8lO8Rj6HIJ9h+i7/7t1dOMAC2S82VSI4PKyeys6meiCBfEfo614i IXh3McnCpuKMlWHD7HZbV/v69iAkLyeRgNaSoi48ZbTbBQZCKeOmlswKLl3TOHbjM8TH Z+seY9iRCfW71MfROAj33NPcB6EPsjnywwrPK2TyFH8UzQcjk0fbQNFbHGYOZmJi9oUs h1SA== Received: by 10.236.156.233 with SMTP id m69mr22619097yhk.128.1332787767005; Mon, 26 Mar 2012 11:49:27 -0700 (PDT) Received: from [10.1.1.2] (189.26.33.225.dynamic.adsl.gvt.net.br. [189.26.33.225]) by mx.google.com with ESMTPS id d25sm49230335yhe.4.2012.03.26.11.49.25 (version=SSLv3 cipher=OTHER); Mon, 26 Mar 2012 11:49:26 -0700 (PDT) Message-ID: <1332787763.30339.10.camel@hactar> Subject: [RFA] Define Elf32_auxv_t and Elf64_auxv_t if not available. From: Thiago Jung Bauermann To: gdb-patches ml Date: Mon, 26 Mar 2012 18:49:00 -0000 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlI/1vk9UTlJ/pHTuDe42iB6fWqo+RXP8Lgcrqyr/ggc0eTOR5QmTb9j6esulp4b6Rp1/NN Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00876.txt.bz2 Hi, glibc's says this about Elf32_auxv_t and Elf64_auxv_t: The vector is not usually defined in a standard file, but it can't hurt. We rename it to avoid conflicts. Android's bionic libc doesn't define these types in . 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 * 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 #include +#include ]) 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 @@ #endif #endif +#ifndef HAVE_ELF32_AUXV_T +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 +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.