From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4kxE-0004Da-Uj for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4kxB-0006n7-AY for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:40 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:33221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4kxB-0006mm-38 for qemu-devel@nongnu.org; Tue, 16 Jun 2015 03:06:37 -0400 Received: by lblr1 with SMTP id r1so4732539lbl.0 for ; Tue, 16 Jun 2015 00:06:36 -0700 (PDT) From: riku.voipio@linaro.org Date: Tue, 16 Jun 2015 10:06:28 +0300 Message-Id: <79cb1f1d698da5e1e183863aa3c8a91b2e750664.1434438233.git.riku.voipio@linaro.org> In-Reply-To: References: Subject: [Qemu-devel] [PULL v2 2/6] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Yongbok Kim , peter.maydell@linaro.org From: Yongbok Kim 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 Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- 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