From patchwork Tue Jun 16 07:06:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 49946 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9549D205DE for ; Tue, 16 Jun 2015 07:07:59 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf2054934lbb.0 for ; Tue, 16 Jun 2015 00:07:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=M7jjBEchjiSzrrCDZyKRMQP1wNPTDrdir30clVHn67M=; b=k3q7bkD651tpouL9/Xh4pTwVuEatymLTQ6oUdvuOiJE5QDPewl4utbCPfuCkVWXHfa nilxFa6qQRkp2h2FzWmYzHgpIjaBOMCURLZtkMOhUtzEbn6xIegu1XK42MgSLA2HZ7OE Hr0JbdDWWI1qDxkrPUTlWoQL54j852M4/Kddu36Ubq81z0n057Czt9fF1Ag4ChDEsPHP osBnYIpBVX8CQhq5iB2UBMvm0skAgGVl2hg+pD2B5vEtbD0kkszN5NASxSTo0GF2tUJT zVoJg4J1AII19FJpHA4LEazlWo2pg/vpxmhHwvvkweKLJVmdrNU2d+KZlGVptu7CLeGv 1gfA== X-Gm-Message-State: ALoCoQmsdipfS3SmzbrW1tYKtDe5BNkTYn/FD68MKQwYoZrUNLjoO4SI34U+rO8A8W3ITso3gOfy X-Received: by 10.180.105.226 with SMTP id gp2mr23487193wib.1.1434438478297; Tue, 16 Jun 2015 00:07:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.73 with SMTP id i9ls37687lai.100.gmail; Tue, 16 Jun 2015 00:07:58 -0700 (PDT) X-Received: by 10.153.7.104 with SMTP id db8mr32121003lad.124.1434438478084; Tue, 16 Jun 2015 00:07:58 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id w5si90855laj.65.2015.06.16.00.07.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 00:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labbc20 with SMTP id bc20so4839095lab.1 for ; Tue, 16 Jun 2015 00:07:58 -0700 (PDT) X-Received: by 10.152.225.166 with SMTP id rl6mr31439462lac.36.1434438477993; Tue, 16 Jun 2015 00:07:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1913295lbb; Tue, 16 Jun 2015 00:07:56 -0700 (PDT) X-Received: by 10.55.16.218 with SMTP id 87mr69118814qkq.67.1434438473229; Tue, 16 Jun 2015 00:07:53 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e130si98758qhc.42.2015.06.16.00.07.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Jun 2015 00:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:38159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4kyO-0005bH-8Y for patch@linaro.org; Tue, 16 Jun 2015 03:07:52 -0400 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) X-Received: by 10.152.234.233 with SMTP id uh9mr31552154lac.64.1434438396305; Tue, 16 Jun 2015 00:06:36 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id wc8sm27104lbb.37.2015.06.16.00.06.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jun 2015 00:06:35 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 16 Jun 2015 10:06:28 +0300 Message-Id: <79cb1f1d698da5e1e183863aa3c8a91b2e750664.1434438233.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.170 Cc: Yongbok Kim , peter.maydell@linaro.org Subject: [Qemu-devel] [PULL v2 2/6] linux-user: Use abi_ulong for TARGET_ELF_PAGESTART X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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