From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YziFH-0003jx-Ke for qemu-devel@nongnu.org; Tue, 02 Jun 2015 05:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YziFD-0002yu-Hk for qemu-devel@nongnu.org; Tue, 02 Jun 2015 05:12:27 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:7901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YziFD-0002y8-CQ for qemu-devel@nongnu.org; Tue, 02 Jun 2015 05:12:23 -0400 Message-ID: <556D7375.8090404@imgtec.com> Date: Tue, 2 Jun 2015 10:12:21 +0100 From: Yongbok Kim MIME-Version: 1.0 References: <1429542920-47029-1-git-send-email-yongbok.kim@imgtec.com> In-Reply-To: <1429542920-47029-1-git-send-email-yongbok.kim@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] 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: peter.maydell@linaro.org, riku.voipio@iki.fi ping! On 20/04/2015 16:15, Yongbok Kim wrote: > 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 > --- > 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 >