qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART


From: Yongbok Kim
Subject: [Qemu-devel] [PATCH] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART
Date: Mon, 20 Apr 2015 16:15:20 +0100

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>
---
 linux-user/elfload.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 399c021..edf0cf4 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1227,7 +1227,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
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]