[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.