[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 2/6] linux-user: Use abi_ulong for TARGET_ELF_PAGE
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL v2 2/6] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART |
Date: |
Tue, 16 Jun 2015 10:06:28 +0300 |
From: Yongbok Kim <address@hidden>
TARGET_ELF_PAGESTART is required to use abi_ulong to correctly handle
addresses for different target bits width.
This patch fixes a problem when running a 64-bit user mode application
on 32-bit host machines.
Signed-off-by: Yongbok Kim <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/elfload.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index b71e866..1788368 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1256,7 +1256,8 @@ struct exec
/* Necessary parameters */
#define TARGET_ELF_EXEC_PAGESIZE TARGET_PAGE_SIZE
-#define TARGET_ELF_PAGESTART(_v) ((_v) & ~(unsigned
long)(TARGET_ELF_EXEC_PAGESIZE-1))
+#define TARGET_ELF_PAGESTART(_v) ((_v) & \
+ ~(abi_ulong)(TARGET_ELF_EXEC_PAGESIZE-1))
#define TARGET_ELF_PAGEOFFSET(_v) ((_v) & (TARGET_ELF_EXEC_PAGESIZE-1))
#define DLINFO_ITEMS 14
--
2.1.4
- [Qemu-devel] [PULL v2 0/6] linux-user patches for 2.4 softfreeze, riku . voipio, 2015/06/16
- [Qemu-devel] [PULL v2 1/6] linux-user: Allocate thunk size dynamically, riku . voipio, 2015/06/16
- [Qemu-devel] [PULL v2 2/6] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART,
riku . voipio <=
- [Qemu-devel] [PULL v2 3/6] linux-user: Fix length handling in host_to_target_cmsg, riku . voipio, 2015/06/16
- [Qemu-devel] [PULL v2 4/6] linux-user: use __get_user and __put_user in cmsg conversions, riku . voipio, 2015/06/16
- [Qemu-devel] [PULL v2 5/6] linux-user: fix the breakpoint inheritance in spawned threads, riku . voipio, 2015/06/16
- [Qemu-devel] [PULL v2 6/6] linux-user: ioctl() command type is int, riku . voipio, 2015/06/16
- Re: [Qemu-devel] [PULL v2 0/6] linux-user patches for 2.4 softfreeze, Peter Maydell, 2015/06/16