|
From: | Alexander Graf |
Subject: | Re: [Qemu-devel] [PATCH] target-arm: Load ELF images with the correct machine type for CPU |
Date: | Thu, 10 Apr 2014 15:42:29 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 21.03.14 19:44, Peter Maydell wrote:
When trying to load an ELF file specified via -kernel, we need to pass load_elf() the ELF machine type corresponding to the CPU we're booting with, not the one corresponding to the softmmu binary we happen to be running. (The two are different in the case of loading a 32-bit ARM ELF file into a 32 bit CPU being emulated by qemu-system aarch64.) This was causing us to incorrectly fail to load ELF images in this situation. Signed-off-by: Peter Maydell <address@hidden> --- This isn't really a big deal since we can just say "use the qemu-system-arm binary instead". However maybe we should put this into 2.0. Opinions? Incidentally I suspect hw/i386/multiboot.c has a similar problem where it calls load_elf() passing ELF_MACHINE.
We have some compatibility code in the elf loader that says "if elf_machine == ppc64, then allow loading of ppc32 binaries too":
http://git.qemu.org/?p=qemu.git;a=blob;f=include/hw/elf_ops.h;h=c6b5129bab394704cf2197fe079ab195ec84ec2a;hb=HEAD#l213which we need because our mac99 firmware is 32bit, but does know how to drive a ppc64 CPU. I suppose your case is slightly different for AArch64 which is not compatible with 32bit binaries on firmware level.
Alex
[Prev in Thread] | Current Thread | [Next in Thread] |