From owner-svn-src-head@freebsd.org Thu Dec 3 12:21:19 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF8BA40F80; Thu, 3 Dec 2015 12:21:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DB581CF6; Thu, 3 Dec 2015 12:21:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB3CLI2w084901; Thu, 3 Dec 2015 12:21:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB3CLIwU084900; Thu, 3 Dec 2015 12:21:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512031221.tB3CLIwU084900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 3 Dec 2015 12:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291692 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2015 12:21:20 -0000 Author: emaste Date: Thu Dec 3 12:21:18 2015 New Revision: 291692 URL: https://svnweb.freebsd.org/changeset/base/291692 Log: readelf: add Xen ELF notes Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4356 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu Dec 3 12:17:09 2015 (r291691) +++ head/contrib/elftoolchain/readelf/readelf.c Thu Dec 3 12:21:18 2015 (r291692) @@ -332,6 +332,7 @@ static const char *note_type_gnu(unsigne static const char *note_type_netbsd(unsigned int nt); static const char *note_type_openbsd(unsigned int nt); static const char *note_type_unknown(unsigned int nt); +static const char *note_type_xen(unsigned int nt); static const char *option_kind(uint8_t kind); static const char *phdr_type(unsigned int ptype); static const char *ppc_abi_fp(uint64_t fp); @@ -1585,6 +1586,8 @@ note_type(const char *name, unsigned int return note_type_netbsd(nt); else if (strcmp(name, "OpenBSD") == 0 && et != ET_CORE) return note_type_openbsd(nt); + else if (strcmp(name, "Xen") == 0 && et != ET_CORE) + return note_type_xen(nt); return note_type_unknown(nt); } @@ -1693,6 +1696,32 @@ note_type_unknown(unsigned int nt) return (s_nt); } +static const char * +note_type_xen(unsigned int nt) +{ + switch (nt) { + case 0: return "XEN_ELFNOTE_INFO"; + case 1: return "XEN_ELFNOTE_ENTRY"; + case 2: return "XEN_ELFNOTE_HYPERCALL_PAGE"; + case 3: return "XEN_ELFNOTE_VIRT_BASE"; + case 4: return "XEN_ELFNOTE_PADDR_OFFSET"; + case 5: return "XEN_ELFNOTE_XEN_VERSION"; + case 6: return "XEN_ELFNOTE_GUEST_OS"; + case 7: return "XEN_ELFNOTE_GUEST_VERSION"; + case 8: return "XEN_ELFNOTE_LOADER"; + case 9: return "XEN_ELFNOTE_PAE_MODE"; + case 10: return "XEN_ELFNOTE_FEATURES"; + case 11: return "XEN_ELFNOTE_BSD_SYMTAB"; + case 12: return "XEN_ELFNOTE_HV_START_LOW"; + case 13: return "XEN_ELFNOTE_L1_MFN_VALID"; + case 14: return "XEN_ELFNOTE_SUSPEND_CANCEL"; + case 15: return "XEN_ELFNOTE_INIT_P2M"; + case 16: return "XEN_ELFNOTE_MOD_START_PFN"; + case 17: return "XEN_ELFNOTE_SUPPORTED_FEATURES"; + default: return (note_type_unknown(nt)); + } +} + static struct { const char *name; int value;