From e136047e00e3b79a2a2c6e3738da0ac58a24ad44 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 12 Nov 2015 14:56:01 +0000 Subject: [PATCH] Create hvm64 test binaries as elf32 New improvements to the HVM domain building logic actually sanity check the binary for being 32bit, as all HVM domains start in 32bit mode. Previously, elf64 binaries were erroneously accepted. In addition, drop the big/little endian bits. x86 is unlikely to ever have a big endian variant. Signed-off-by: Andrew Cooper --- arch/x86/link.lds.S | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/x86/link.lds.S b/arch/x86/link.lds.S index 22f48a2..93e362a 100644 --- a/arch/x86/link.lds.S +++ b/arch/x86/link.lds.S @@ -7,12 +7,25 @@ #if defined(__x86_64__) -OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") +#if defined(CONFIG_ENV_hvm64) + +/* + * All HVM guests start in 32bit mode in a stub + * which switches to the desired running mode. + */ +OUTPUT_FORMAT("elf32-x86-64") + +#else + +OUTPUT_FORMAT("elf64-x86-64") + +#endif + OUTPUT_ARCH(i386:x86-64) #elif defined(__i386__) -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") +OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH(i386) #else -- 2.39.5