[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 19/60] fix entry pointer for ELF kernels loaded wit
From: |
Michael Tokarev |
Subject: |
[Qemu-stable] [PATCH 19/60] fix entry pointer for ELF kernels loaded with -kernel option |
Date: |
Mon, 4 Feb 2013 14:40:29 +0400 |
From: Henning Schild <address@hidden>
Find a hopefully proper patch attached. Take it or leave it.
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Henning Schild <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
(cherry picked from commit 7e9c7ffe9fd9dfc3d0168dd584936db8144b230b)
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/elf_ops.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/elf_ops.h b/hw/elf_ops.h
index fa65ce2..731a983 100644
--- a/hw/elf_ops.h
+++ b/hw/elf_ops.h
@@ -269,6 +269,17 @@ static int glue(load_elf, SZ)(const char *name, int fd,
addr = ph->p_paddr;
}
+ /* the entry pointer in the ELF header is a virtual
+ * address, if the text segments paddr and vaddr differ
+ * we need to adjust the entry */
+ if (pentry && !translate_fn &&
+ ph->p_vaddr != ph->p_paddr &&
+ ehdr.e_entry >= ph->p_vaddr &&
+ ehdr.e_entry < ph->p_vaddr + ph->p_filesz &&
+ ph->p_flags & PF_X) {
+ *pentry = ehdr.e_entry - ph->p_vaddr + ph->p_paddr;
+ }
+
snprintf(label, sizeof(label), "phdr #%d: %s", i, name);
rom_add_blob_fixed(label, data, mem_size, addr);
--
1.7.10.4
- [Qemu-stable] [PATCH 07/60] cpu_physical_memory_write_rom() needs to do TB invalidates, (continued)
- [Qemu-stable] [PATCH 07/60] cpu_physical_memory_write_rom() needs to do TB invalidates, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 26/60] target-i386: Allow tsc-frequency to be larger then 2.147G, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 42/60] target-mips: fix wrong microMIPS opcode encoding, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 57/60] buffered_file: do not send more than s->bytes_xfer bytes per tick, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 25/60] hw: Fix return value check for bdrv_read, bdrv_write, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 30/60] MIPS: Correct FCR0 initialization, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 11/60] net: add -netdev options to man page, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 50/60] slirp: Don't crash on packets from 0.0.0.0/8., Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 58/60] qxl: save qemu_create_displaysurface_from result, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 49/60] tap: reset vnet header size on open, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 19/60] fix entry pointer for ELF kernels loaded with -kernel option,
Michael Tokarev <=
- [Qemu-stable] [PATCH 18/60] e1000: flush queue whenever can_receive can go from false to true, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 27/60] x86: Fixed incorrect segment base address addition in 64-bits mode, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 09/60] ahci: properly reset PxCMD on HBA reset, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 60/60] migration: Fix madvise breakage if host and guest have different page sizes, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 39/60] m68k: Return semihosting errno values correctly, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 40/60] nbd: fixes to read-only handling, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 28/60] Fixes related to processing of qemu's -numa option, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 51/60] vmdk: Fix data corruption bug in WRITE and READ handling, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 59/60] target-xtensa: fix ITLB/DTLB page protection flags, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 55/60] arm_boot: Change initrd load address to "halfway through RAM", Michael Tokarev, 2013/02/04