From patchwork Wed Sep 19 11:49:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 29466 Received: (qmail 50766 invoked by alias); 19 Sep 2018 11:49:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 49344 invoked by uid 89); 19 Sep 2018 11:49:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Sep 2018 11:49:46 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id F37145E2; Wed, 19 Sep 2018 13:49:43 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SNP-xLJZdx1U; Wed, 19 Sep 2018 13:49:40 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id EFA8A5DE; Wed, 19 Sep 2018 13:49:39 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id w8JBndpw020931; Wed, 19 Sep 2018 13:49:39 +0200 (MEST) From: Rainer Orth To: gdb-patches@sourceware.org Cc: binutils@sourceware.org Subject: [PATCH] Handle missing Solaris auxv entries Date: Wed, 19 Sep 2018 13:49:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Currently, three tests FAIL on Solaris 11.4+ (amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11): info auxv [...] 2009 AT_SUN_HWCAP Machine-dependent CPU capability hints 0x3f5ff7 2023 ??? 0x0 0 AT_NULL End of vector 0x0 (gdb) WARNING: Unrecognized tag value: 2023 ??? 0x0 FAIL: gdb.base/auxv.exp: info auxv on live process info auxv 4294969310 ??? 0x7fffbfffe410 9225589753816 ??? 0x7fffbfffe45c [...] WARNING: Unrecognized tag value: 4294969310 ??? 0x7fffbfffe410 WARNING: Unrecognized tag value: 9225589753816 ??? 0x7fffbfffe45c WARNING: Unrecognized tag value: 140733193388037 ??? 0x6 [...] 2009 AT_SUN_HWCAP Machine-dependent CPU capability hints 0x3f5ff7 2023 ??? 0x0 0 AT_NULL End of vector 0x0 (gdb) WARNING: Unrecognized tag value: 2023 ??? 0x0 UNRESOLVED: gdb.base/auxv.exp: info auxv on native core dump info auxv [...] 2009 AT_SUN_HWCAP Machine-dependent CPU capability hints 0x3f5ff7 2023 ??? 0x0 0 AT_NULL End of vector 0x0 (gdb) WARNING: Unrecognized tag value: 2023 ??? 0x0 FAIL: gdb.base/auxv.exp: info auxv on gcore-created dump The following patch fixes this by introducing the missing AT_SUN_* values from Solaris 11.4+ . This lets the live and gcore-created dump tests PASS. I don't know yet what's the reason for those weird 'Unrecognized tag value' warnings with native core dumps is; elfdump -n certainly doesn't show them. However, native core dumps still need quite some work (mostly in bfd) in this and other areas. Tested on amd64-pc-solaris2.11. Ok for master? Rainer # HG changeset patch # Parent 7005944ef9bca8a972c826ef139fadd28c57d6a7 Handle missing Solaris auxv entries diff --git a/gdb/auxv.c b/gdb/auxv.c --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -495,7 +495,7 @@ default_print_auxv_entry (struct gdbarch AUXV_FORMAT_STR); TAG (AT_SUN_LPAGESZ, _("Large pagesize"), AUXV_FORMAT_DEC); TAG (AT_SUN_PLATFORM, _("Platform name string"), AUXV_FORMAT_STR); - TAG (AT_SUN_HWCAP, _("Machine-dependent CPU capability hints"), + TAG (AT_SUN_CAP_HW1, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX); TAG (AT_SUN_IFLUSH, _("Should flush icache?"), AUXV_FORMAT_DEC); TAG (AT_SUN_CPU, _("CPU name string"), AUXV_FORMAT_STR); @@ -509,6 +509,17 @@ default_print_auxv_entry (struct gdbarch AUXV_FORMAT_HEX); TAG (AT_SUN_AUXFLAGS, _("AF_SUN_ flags passed from the kernel"), AUXV_FORMAT_HEX); + TAG (AT_SUN_EMULATOR, _("Name of emulation binary for runtime linker"), + AUXV_FORMAT_STR); + TAG (AT_SUN_BRANDNAME, _("Name of brand library"), AUXV_FORMAT_STR); + TAG (AT_SUN_BRAND_AUX1, _("Aux vector for brand modules 1"), + AUXV_FORMAT_HEX); + TAG (AT_SUN_BRAND_AUX2, _("Aux vector for brand modules 2"), + AUXV_FORMAT_HEX); + TAG (AT_SUN_BRAND_AUX3, _("Aux vector for brand modules 3"), + AUXV_FORMAT_HEX); + TAG (AT_SUN_CAP_HW2, _("Machine-dependent CPU capability hints 2"), + AUXV_FORMAT_HEX); } fprint_auxv_entry (file, name, description, format, type, val); diff --git a/include/elf/common.h b/include/elf/common.h --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1164,9 +1164,9 @@ #define AT_SUN_LDNAME 2006 /* String giving name of dynamic linker. */ #define AT_SUN_LPAGESZ 2007 /* Large pagesize. */ #define AT_SUN_PLATFORM 2008 /* Platform name string. */ -#undef AT_SUN_HWCAP -#define AT_SUN_HWCAP 2009 /* Machine dependent hints about +#define AT_SUN_CAP_HW1 2009 /* Machine dependent hints about processor capabilities. */ +#define AT_SUN_HWCAP AT_SUN_CAP_HW1 /* For backward compat only. */ #define AT_SUN_IFLUSH 2010 /* Should flush icache? */ #define AT_SUN_CPU 2011 /* CPU name string. */ #define AT_SUN_EMUL_ENTRY 2012 /* COFF entry point address. */ @@ -1175,6 +1175,12 @@ #define AT_SUN_MMU 2015 /* String for name of MMU module. */ #define AT_SUN_LDDATA 2016 /* Dynamic linker's data segment address. */ #define AT_SUN_AUXFLAGS 2017 /* AF_SUN_ flags passed from the kernel. */ - +#define AT_SUN_EMULATOR 2018 /* Name of emulation binary for runtime + linker. */ +#define AT_SUN_BRANDNAME 2019 /* Name of brand library. */ +#define AT_SUN_BRAND_AUX1 2020 /* Aux vectors for brand modules. */ +#define AT_SUN_BRAND_AUX2 2021 +#define AT_SUN_BRAND_AUX3 2022 +#define AT_SUN_CAP_HW2 2023 /* Extension of AT_SUN_CAP_HW1. */ #endif /* _ELF_COMMON_H */