WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch] allow big-endian elf images if supported

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch] allow big-endian elf images if supported
From: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Date: Mon, 15 May 2006 09:06:06 -0400
Delivery-date: Mon, 15 May 2006 06:06:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
I think the ifdef's here are pretty dubious especially ELFCLASSxx, and on PPC we blow passed them all and then endian catches us, we can hit those later, but for no the endian test needs a little more.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---

diff -r cb70d4f8d718 tools/libxc/xc_load_elf.c
--- a/tools/libxc/xc_load_elf.c Mon May 15 07:51:07 2006 +0100
+++ b/tools/libxc/xc_load_elf.c Mon May 15 07:53:11 2006 -0400
@@ -13,6 +13,7 @@
#include "xc_elf.h"
#include <stdlib.h>
+#include <endian.h>
#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
#define round_pgdown(_p)  ((_p)&PAGE_MASK)
@@ -77,7 +78,13 @@ static int parseelfimage(const char *ima
         (ehdr->e_ident[EI_CLASS] != ELFCLASS64) ||
         (ehdr->e_machine != EM_X86_64) ||
#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
         (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) ||
+#elif  __BYTE_ORDER == __BIG_ENDIAN
+        (ehdr->e_ident[EI_DATA] != ELFDATA2MSB) ||
+#else
+#error "Byte order unknown"
+#endif
         (ehdr->e_type != ET_EXEC) )
     {
         ERROR("Kernel not a Xen-compatible Elf image.");


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>