From nobody Mon May 6 02:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1587043057; cv=none; d=zohomail.com; s=zohoarc; b=ViFso+t+5lJU6scLyGZWczlgDNLZhOrItHpS88+12gP93Lzu0tZ58bJ2G1IvgJ5aasWcHkjPHacSxsn3hI8yZL0z1NKj3L5COSdWju0Kn8wKvnioyhs5wpuJB75iuSFojRD9NjHV/8guEB8CLMVjrAFLsNoYbXJZvtOfJk8Ryr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587043057; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=jTsKz8QtNWd0bKswVk42g3mAiMyp54Dtb7w1RPtwxTM=; b=QTjPzOvwILQak6ejOMst+08XHDLooZ4gkuKreEsmlqxMnjwgsp+Ik70GQCwhj+MsyhhPxBdwCChge1tPnf8pEyXPng75SvANt5MgfLzFEBl19W2lrSR7X+ySbl8tZJYLaLD/J7K1HA8mvPz54Stuu4f+17peUGpHY8NoC069KnY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1587043057608903.1795091077573; Thu, 16 Apr 2020 06:17:37 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jP4OO-0000QR-I9; Thu, 16 Apr 2020 13:17:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jP4ON-0000QM-Pi for xen-devel@lists.xenproject.org; Thu, 16 Apr 2020 13:17:19 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 98912a10-7fe4-11ea-8b92-12813bfff9fa; Thu, 16 Apr 2020 13:17:18 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B58E7AC6D; Thu, 16 Apr 2020 13:17:16 +0000 (UTC) X-Inumbo-ID: 98912a10-7fe4-11ea-8b92-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org Subject: [PATCH v2] mini-os: use -m elf_i386 for final linking Date: Thu, 16 Apr 2020 15:17:15 +0200 Message-Id: <20200416131715.24498-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , samuel.thibault@ens-lyon.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Using the standard -m elf_x86_64 for 64-bit mini-os results in the first section (.text) to start only at offset 2MB in the binary file. Quoting Andrew Cooper on that topic: Specifically, 64bit emulation appears to include "align primary sections to 2M so your OS can make better use of superpages even when mmap()ing", with no way I can spot to override this in the linker file. Using -m elf_i386 avoids that problem without any visible disadvantage. Signed-off-by: Juergen Gross --- arch/x86/arch.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/arch.mk b/arch/x86/arch.mk index c87885f..00028a0 100644 --- a/arch/x86/arch.mk +++ b/arch/x86/arch.mk @@ -26,3 +26,5 @@ ifeq ($(CONFIG_PARAVIRT),n) ARCH_LDFLAGS_FINAL :=3D --oformat=3Delf32-i386 ARCH_AS_DEPS +=3D x86_hvm.S endif + +ARCH_LDFLAGS_FINAL +=3D -m elf_i386 --=20 2.16.4