From owner-svn-src-all@FreeBSD.ORG Fri Jul 19 01:04:17 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]) by hub.freebsd.org (Postfix) with ESMTP id D1C6C6D5; Fri, 19 Jul 2013 01:04:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C421D362; Fri, 19 Jul 2013 01:04:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6J14H5R042742; Fri, 19 Jul 2013 01:04:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6J14HNt042741; Fri, 19 Jul 2013 01:04:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307190104.r6J14HNt042741@svn.freebsd.org> From: Ed Maste Date: Fri, 19 Jul 2013 01:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253461 - head/contrib/binutils/binutils 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, 19 Jul 2013 01:04:17 -0000 Author: emaste Date: Fri Jul 19 01:04:17 2013 New Revision: 253461 URL: http://svnweb.freebsd.org/changeset/base/253461 Log: Correct ELF note decoding for non-core files Requested by: kib Modified: head/contrib/binutils/binutils/readelf.c Modified: head/contrib/binutils/binutils/readelf.c ============================================================================== --- head/contrib/binutils/binutils/readelf.c Fri Jul 19 00:12:41 2013 (r253460) +++ head/contrib/binutils/binutils/readelf.c Fri Jul 19 01:04:17 2013 (r253461) @@ -9128,8 +9128,10 @@ get_note_type (unsigned e_type) } static const char * -get_freebsd_elfcore_note_type (unsigned e_type) +get_freebsd_note_type (unsigned e_type) { + static char buff[64]; + if (elf_header.e_type == ET_CORE) switch (e_type) { @@ -9154,10 +9156,21 @@ get_freebsd_elfcore_note_type (unsigned case NT_PROCSTAT_AUXV: return _("NT_PROCSTAT_AUXV (auxv data)"); default: + return get_note_type(e_type); + } + else + switch (e_type) + { + case NT_FREEBSD_ABI_TAG: + return _("NT_FREEBSD_ABI_TAG"); + case NT_FREEBSD_NOINIT_TAG: + return _("NT_FREEBSD_NOINIT_TAG"); + default: break; } - return get_note_type(e_type); + snprintf (buff, sizeof(buff), _("Unknown note type: (0x%08x)"), e_type); + return buff; } static const char * @@ -9239,7 +9252,7 @@ process_note (Elf_Internal_Note *pnote) else if (const_strneq (pnote->namedata, "FreeBSD")) /* FreeBSD-specific core file notes. */ - nt = get_freebsd_elfcore_note_type (pnote->type); + nt = get_freebsd_note_type (pnote->type); else if (const_strneq (pnote->namedata, "NetBSD-CORE")) /* NetBSD-specific core file notes. */