diff options
author | Stefano Garzarella | 2019-07-24 16:31:03 +0200 |
---|---|---|
committer | Paolo Bonzini | 2019-08-20 17:26:18 +0200 |
commit | fef28891aa401e8f9d048c65f32067f51d695f4e (patch) | |
tree | 7895421ae53e64a65b0f411e58678d0f59a0a3f9 /include/hw/elf_ops.h | |
parent | target-i386: adds PV_SCHED_YIELD CPUID feature bit (diff) | |
download | qemu-fef28891aa401e8f9d048c65f32067f51d695f4e.tar.gz qemu-fef28891aa401e8f9d048c65f32067f51d695f4e.tar.xz qemu-fef28891aa401e8f9d048c65f32067f51d695f4e.zip |
loader: Handle memory-mapped ELFs
This patch allows handling an ELF memory-mapped, taking care
the reference count of the GMappedFile* passed through
rom_add_elf_program().
In this case, the 'data' pointer is not heap-allocated, so
we cannot free it.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20190724143105.307042-2-sgarzare@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/elf_ops.h')
-rw-r--r-- | include/hw/elf_ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 690f9238c8..fede37ee9c 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -525,7 +525,7 @@ static int glue(load_elf, SZ)(const char *name, int fd, snprintf(label, sizeof(label), "phdr #%d: %s", i, name); /* rom_add_elf_program() seize the ownership of 'data' */ - rom_add_elf_program(label, data, file_size, mem_size, + rom_add_elf_program(label, NULL, data, file_size, mem_size, addr, as); } else { address_space_write(as ? as : &address_space_memory, |