From patchwork Wed Aug 12 06:03:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 506327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8C3471401AF for ; Wed, 12 Aug 2015 16:04:53 +1000 (AEST) Received: from localhost ([::1]:37020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPP9f-00021p-MU for incoming@patchwork.ozlabs.org; Wed, 12 Aug 2015 02:04:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPP8l-0000ec-BY for qemu-devel@nongnu.org; Wed, 12 Aug 2015 02:03:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPP8g-0005UP-61 for qemu-devel@nongnu.org; Wed, 12 Aug 2015 02:03:55 -0400 Received: from col004-omc3s14.hotmail.com ([65.55.34.152]:64971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPP8g-0005UF-0Q for qemu-devel@nongnu.org; Wed, 12 Aug 2015 02:03:50 -0400 Received: from COL130-W58 ([65.55.34.137]) by COL004-OMC3S14.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 11 Aug 2015 23:03:49 -0700 X-TMN: [JLhZ2tbMDE+UPmDgaXBkJ/9W/BnsoYFV] X-Originating-Email: [xili_gchen_5257@hotmail.com] Message-ID: From: gchen gchen To: Riku Voipio , Richard Henderson , "agraf@suse.de" Date: Wed, 12 Aug 2015 14:03:48 +0800 Importance: Normal In-Reply-To: <55CAE18F.9080004@hotmail.com> References: <55CAE18F.9080004@hotmail.com> MIME-Version: 1.0 X-OriginalArrivalTime: 12 Aug 2015 06:03:49.0253 (UTC) FILETIME=[A8176B50:01D0D4C4] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 65.55.34.152 Cc: QEMU Developers Subject: [Qemu-devel] [PATCH] linux-user: elfload: Still use TARGET_PAGE_SIZE for i386 guest 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Under Alpha host, for ubuntu12.04.5 i386 guest, it will cause failure: "Invalid ELF image for this architecture". The related issue commit is "a70daba linux-user: Tell guest about big host page sizes". Signed-off-by: Chen Gang --- linux-user/elfload.c | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.1 diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 1788368..f4cf9b6 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1614,7 +1614,11 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc, NEW_AUX_ENT(AT_PHDR, (abi_ulong)(info->load_addr + exec->e_phoff)); NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr))); NEW_AUX_ENT(AT_PHNUM, (abi_ulong)(exec->e_phnum)); +#ifdef TARGET_I386 + NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)TARGET_PAGE_SIZE); +#else NEW_AUX_ENT(AT_PAGESZ, (abi_ulong)(MAX(TARGET_PAGE_SIZE, getpagesize()))); +#endif NEW_AUX_ENT(AT_BASE, (abi_ulong)(interp_info ? interp_info->load_addr : 0)); NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0); NEW_AUX_ENT(AT_ENTRY, info->entry);