Jimi Xenidis
2006-May-15 13:06 UTC
[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@watson.ibm.com> --- 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@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-15 13:20 UTC
Re: [Xen-devel] [patch] allow big-endian elf images if supported
On 15 May 2006, at 14:06, Jimi Xenidis wrote:> 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@watson.ibm.com>patch complains that the diff is malformed. Perhaps your mail client chewed it. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel