summary refs log tree commit diff stats
path: root/hw/mips/mipssim.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/mips/mipssim.c')
-rw-r--r--hw/mips/mipssim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index a294779a82..c530688e76 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -73,7 +73,8 @@ static uint64_t load_kernel(void)
     kernel_size = load_elf(loaderparams.kernel_filename, NULL,
                            cpu_mips_kseg0_to_phys, NULL,
                            &entry, NULL,
-                           &kernel_high, NULL, TARGET_BIG_ENDIAN,
+                           &kernel_high, NULL,
+                           TARGET_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB,
                            EM_MIPS, 1, 0);
     if (kernel_size < 0) {
         error_report("could not load kernel '%s': %s",