From owner-svn-src-all@FreeBSD.ORG Fri Sep 13 18:21:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1138A7B9; Fri, 13 Sep 2013 18:21:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3EC72765; Fri, 13 Sep 2013 18:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8DILVL0071703; Fri, 13 Sep 2013 18:21:31 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8DILV9o071701; Fri, 13 Sep 2013 18:21:31 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201309131821.r8DILV9o071701@svn.freebsd.org> From: Ed Maste Date: Fri, 13 Sep 2013 18:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255522 - in head/contrib/binutils: binutils include/elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Sep 2013 18:21:32 -0000 Author: emaste Date: Fri Sep 13 18:21:31 2013 New Revision: 255522 URL: http://svnweb.freebsd.org/changeset/base/255522 Log: Improve readelf notes output for Linux ELF files Add four ELF note constants: - NT_FILE and NT_SIGINFO (core file notes output by recent Linux kernels) - NT_GNU_ABI_TAG (was incorrectly reported as NT_VERSION) - NT_GNU_BUILD_ID (used for locating standalone debug files) Approved by: re (kib) Modified: head/contrib/binutils/binutils/readelf.c head/contrib/binutils/include/elf/common.h Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Fri Sep 13 16:57:28 2013 (r255521) +++ head/contrib/binutils/binutils/readelf.c Fri Sep 13 18:21:31 2013 (r255522) @@ -9109,6 +9109,10 @@ get_note_type (unsigned e_type) return _("NT_LWPSINFO (lwpsinfo_t structure)"); case NT_WIN32PSTATUS: return _("NT_WIN32PSTATUS (win32_pstatus structure)"); + case NT_FILE: + return _("NT_FILE"); + case NT_SIGINFO: + return _("NT_SIGINFO"); default: break; } @@ -9174,6 +9178,23 @@ get_freebsd_note_type (unsigned e_type) } static const char * +get_gnu_note_type (unsigned e_type) +{ + static char buff[64]; + + switch (e_type) + { + case NT_GNU_ABI_TAG: + return _("NT_GNU_ABI_TAG"); + case NT_GNU_BUILD_ID: + return _("NT_GNU_BUILD_ID"); + } + + snprintf (buff, sizeof(buff), _("Unknown GNU note type: (0x%08x)"), e_type); + return buff; +} + +static const char * get_netbsd_elfcore_note_type (unsigned e_type) { static char buff[64]; @@ -9254,6 +9275,10 @@ process_note (Elf_Internal_Note *pnote) /* FreeBSD-specific core file notes. */ nt = get_freebsd_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "GNU")) + /* GNU-specific notes */ + nt = get_gnu_note_type (pnote->type); + else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */ nt = get_netbsd_elfcore_note_type (pnote->type); Modified: head/contrib/binutils/include/elf/common.h ============================================================================== --- head/contrib/binutils/include/elf/common.h Fri Sep 13 16:57:28 2013 (r255521) +++ head/contrib/binutils/include/elf/common.h Fri Sep 13 18:21:31 2013 (r255522) @@ -388,8 +388,10 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ +#define NT_FILE 0x46494c45 #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ +#define NT_SIGINFO 0x53494749 /* Note segments for core files on dir-style procfs systems. */ @@ -435,6 +437,9 @@ #define GNU_ABI_TAG_FREEBSD 3 #define GNU_ABI_TAG_NETBSD 4 +/* Values for GNU .note.gnu.build-id notes. Note name is "GNU"." */ +#define NT_GNU_BUILD_ID 3 + /* Values for NetBSD .note.netbsd.ident notes. Note name is "NetBSD". */ #define NT_NETBSD_IDENT 1