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 <andrew.cooper3@citrix.com>
#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