From patchwork Fri Sep 22 22:57:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 23097 Received: (qmail 86224 invoked by alias); 22 Sep 2017 22:58:17 -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 85532 invoked by uid 89); 22 Sep 2017 22:58:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Effective X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Sep 2017 22:58:15 +0000 Received: from ralph.baldwin.cx.com (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id D618510A87D; Fri, 22 Sep 2017 18:58:13 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH v2 1/4] Handle FreeBSD-specific AT_EHDRFLAGS and AT_HWCAP auxiliary vector types. Date: Fri, 22 Sep 2017 15:57:10 -0700 Message-Id: <20170922225713.26609-2-jhb@FreeBSD.org> In-Reply-To: <20170922225713.26609-1-jhb@FreeBSD.org> References: <20170922225713.26609-1-jhb@FreeBSD.org> X-IsSubscribed: yes FreeBSD recently added two additional ELF auxiliary vectors. FreeBSD's AT_HWCAP uses a different number compared to AT_HWCAP on Linux as the numerical value was already in use for a different vector on FreeBSD. include/ChangeLog: * elf/common.h (AT_FREEBSD_EHDRFLAGS, AT_FREEBSD_HWCAP): Define. gdb/ChangeLog: * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_EHDRFLAGS and AT_HWCAP. --- gdb/ChangeLog | 5 +++++ gdb/fbsd-tdep.c | 2 ++ include/ChangeLog | 4 ++++ include/elf/common.h | 2 ++ 4 files changed, 13 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa50dc9f5b..7788bfc1a9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-09-22 John Baldwin + + * fbsd-tdep.c (fbsd_print_auxv_entry): Handle AT_EHDRFLAGS and + AT_HWCAP. + 2017-09-22 Tom Tromey * utils.c (class scoped_input_handler) : Change diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c index 1908269632..85dad6be90 100644 --- a/gdb/fbsd-tdep.c +++ b/gdb/fbsd-tdep.c @@ -392,6 +392,8 @@ fbsd_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, TAG (PAGESIZESLEN, _("Number of pagesizes"), AUXV_FORMAT_DEC); TAG (TIMEKEEP, _("Pointer to timehands"), AUXV_FORMAT_HEX); TAG (STACKPROT, _("Initial stack protection"), AUXV_FORMAT_HEX); + TAG (EHDRFLAGS, _("ELF header e_flags"), AUXV_FORMAT_HEX); + TAG (HWCAP, _("Machine-dependent CPU capability hints"), AUXV_FORMAT_HEX); default: default_print_auxv_entry (gdbarch, file, type, val); return; diff --git a/include/ChangeLog b/include/ChangeLog index 0ece8de3f7..a563f3eb67 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2017-09-22 John Baldwin + + * elf/common.h (AT_FREEBSD_EHDRFLAGS, AT_FREEBSD_HWCAP): Define. + 2017-09-22 Alexandre Oliva * dwarf2.def (DW_AT_GNU_locviews): New. diff --git a/include/elf/common.h b/include/elf/common.h index d08731cca1..f89ab32889 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1144,6 +1144,8 @@ #define AT_FREEBSD_PAGESIZESLEN 21 /* Number of pagesizes. */ #define AT_FREEBSD_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_FREEBSD_STACKPROT 23 /* Initial stack protection. */ +#define AT_FREEBSD_EHDRFLAGS 24 /* e_flags field from ELF header. */ +#define AT_FREEBSD_HWCAP 25 /* CPU feature flags. */ #define AT_SUN_UID 2000 /* Effective user ID. */ #define AT_SUN_RUID 2001 /* Real user ID. */