]> git.proxmox.com Git - mirror_qemu.git/commit - hw/alpha/dp264.c
loader: Add data swap option to load-elf
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>
Fri, 4 Mar 2016 11:30:21 +0000 (11:30 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 4 Mar 2016 11:30:21 +0000 (11:30 +0000)
commit7ef295ea5b412cbaf82f719ccd49efb51296e841
treeda99e5270fcf99285c0b5dfb787c4b304687843a
parent140b7ce5fff6fc660b2484dfd9d33ed2e42ec5a9
loader: Add data swap option to load-elf

Some CPUs are of an opposite data-endianness to other components in the
system. Sometimes elfs have the data sections layed out with this CPU
data-endianness accounting for when loaded via the CPU, so byte swaps
(relative to other system components) will occur.

The leading example, is ARM's BE32 mode, which is is basically LE with
address manipulation on half-word and byte accesses to access the
hw/byte reversed address. This means that word data is invariant
across LE and BE32. This also means that instructions are still LE.
The expectation is that the elf will be loaded via the CPU in this
endianness scheme, which means the data in the elf is reversed at
compile time.

As QEMU loads via the system memory directly, rather than the CPU, we
need a mechanism to reverse elf data endianness to implement this
possibility.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
34 files changed:
hw/alpha/dp264.c
hw/arm/armv7m.c
hw/arm/boot.c
hw/core/loader.c
hw/cris/boot.c
hw/i386/multiboot.c
hw/lm32/lm32_boards.c
hw/lm32/milkymist.c
hw/m68k/an5206.c
hw/m68k/dummy_m68k.c
hw/m68k/mcf5208.c
hw/microblaze/boot.c
hw/mips/mips_fulong2e.c
hw/mips/mips_malta.c
hw/mips/mips_mipssim.c
hw/mips/mips_r4k.c
hw/moxie/moxiesim.c
hw/openrisc/openrisc_sim.c
hw/pci-host/prep.c
hw/ppc/e500.c
hw/ppc/mac_newworld.c
hw/ppc/mac_oldworld.c
hw/ppc/ppc440_bamboo.c
hw/ppc/spapr.c
hw/ppc/virtex_ml507.c
hw/s390x/ipl.c
hw/sparc/leon3.c
hw/sparc/sun4m.c
hw/sparc64/sun4u.c
hw/tricore/tricore_testboard.c
hw/xtensa/sim.c
hw/xtensa/xtfpga.c
include/hw/elf_ops.h
include/hw/loader.h