Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2015 12:21:18 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291692 - head/contrib/elftoolchain/readelf
Message-ID:  <201512031221.tB3CLIwU084900@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512031221.tB3CLIwU084900>