For legacy binaries, legacy_binary_is_big_endian() is equivalent of the compile time TARGET_BIG_ENDIAN definition.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> --- hw/xtensa/sim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 1cea29c66d4..cd7c6014c3b 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -26,6 +26,7 @@ */ #include "qemu/osdep.h" +#include "qemu/legacy_binary_info.h" #include "qapi/error.h" #include "system/reset.h" #include "system/system.h" @@ -101,7 +102,8 @@ void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState *machine) uint64_t elf_entry; int success = load_elf(kernel_filename, NULL, translate_phys_addr, cpu, &elf_entry, NULL, NULL, NULL, - TARGET_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB, + legacy_binary_is_big_endian() ? ELFDATA2MSB + : ELFDATA2LSB, EM_XTENSA, 0, 0); if (success > 0) { -- 2.47.1