]> git.proxmox.com Git - mirror_qemu.git/commit
elf: Add optional function ptr to load_elf() to parse ELF notes
authorLiam Merwick <liam.merwick@oracle.com>
Tue, 15 Jan 2019 12:18:03 +0000 (12:18 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Feb 2019 15:50:16 +0000 (16:50 +0100)
commit4366e1db16a3ec7bf24171e5c7619c8ea038e43b
tree6792ae0a31de33061b9f32b182524e033d91e84d
parentd455ebc4f827c14a29240db17931e170b6937c6c
elf: Add optional function ptr to load_elf() to parse ELF notes

This patch adds an optional function pointer, 'elf_note_fn', to
load_elf() which causes load_elf() to additionally parse any
ELF program headers of type PT_NOTE and check to see if the ELF
Note is of the type specified by the 'translate_opaque' arg.
If a matching ELF Note is found then the specfied function pointer
is called to process the ELF note.

Passing a NULL function pointer results in ELF Notes being skipped.

The first consumer of this functionality is the PVHboot support
which needs to read the XEN_ELFNOTE_PHYS32_ENTRY ELF Note while
loading the uncompressed kernel binary in order to discover the
boot entry address for the x86/HVM direct boot ABI.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
41 files changed:
hw/alpha/dp264.c
hw/arm/armv7m.c
hw/arm/boot.c
hw/core/generic-loader.c
hw/core/loader.c
hw/cris/boot.c
hw/hppa/machine.c
hw/i386/multiboot.c
hw/lm32/lm32_boards.c
hw/lm32/milkymist.c
hw/m68k/an5206.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/nios2/boot.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/sam460ex.c
hw/ppc/spapr.c
hw/ppc/virtex_ml507.c
hw/riscv/sifive_e.c
hw/riscv/sifive_u.c
hw/riscv/spike.c
hw/riscv/virt.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