From nobody Wed May 1 22:52:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560942273; cv=none; d=zoho.com; s=zohoarc; b=I5mO2RCyj2IFe1oHnAjfBDl/Lmlrqp9hws0529Hxi7CmlA/y7vwy6vBHaUzWh1GQ5O4TO9r3KLLgbguTdHpphT2sBN7rF6PCcDq78SrGwgxvMX6+jYZTOiaMdgAv5owoAWsPJAQyAG1jbNTNAkQrl6RmlQ12itWYo6/1nupqZHs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560942273; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3FE5dz1xLjiuWk/jbWyscJ5nJ9lVpM4Zv/EhtR0ezUw=; b=ipri18MLxlykFOJtdDbNEd2rJYXSArK3dbtfV12jR9w8L4SgLOINn7V4htDZ2itn9m3M3PSmgW37iwuUFFk47cekFThHSVAP8+5vwiS0rJklXolMM8agqt88Cp0w5hGSQgJ6uX81ZFpTwd6vhxiBz+qC8c3mLaLUCVcauNZxo7Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1560942273767635.262859076486; Wed, 19 Jun 2019 04:04:33 -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 1hdYN1-0002Ej-SU; Wed, 19 Jun 2019 11:03:15 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdYN0-0002ET-RI for xen-devel@lists.xenproject.org; Wed, 19 Jun 2019 11:03:14 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d4e5315d-9281-11e9-8980-bc764e045a96; Wed, 19 Jun 2019 11:03:13 +0000 (UTC) X-Inumbo-ID: d4e5315d-9281-11e9-8980-bc764e045a96 Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: tanGDZs7S97/LIP1WvxXxx3MMCvMDlCrFIqHJ65c3edoLGMzPGjscjLjOrGT9UwYuqcOcxamw1 Q/FvJvEbYRJHD6SbVB+cdGAZR/Vhg+zzRADcTiBgl6MTNyc4yBTNubKCO8sWr1vezw97ibPCK2 BPOHRVV3KhdfxnBOoCrECG/6QBkd5Lqz+OdxdaWCNzEdUxBeGiJx/NnOtJronQxXobv4jgON3o wB13kiVLjk0CrjY6FTf147XB5VCWeXwqeQh0c0RA0dBcIJvOj6Wb4NnHgQMcvW4vfnZ0GfTm06 LVg= X-SBRS: 2.7 X-MesageID: 1926700 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,392,1557201600"; d="scan'208";a="1926700" From: Roger Pau Monne To: Date: Wed, 19 Jun 2019 13:02:47 +0200 Message-ID: <20190619110250.18881-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190619110250.18881-1-roger.pau@citrix.com> References: <20190619110250.18881-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/4] xz: use initconst for hypervisor build 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: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Or else clang adds a .init.rodata.cst8 section to the resulting object file, which is not handled by the Xen linker script and can end up before the text section which contains the headers, thus resulting in a not usable binary. Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- xen/common/decompress.h | 2 ++ xen/common/xz/dec_bcj.c | 6 +++--- xen/common/xz/dec_stream.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/common/decompress.h b/xen/common/decompress.h index 647b7b1e83..4a429bca12 100644 --- a/xen/common/decompress.h +++ b/xen/common/decompress.h @@ -10,6 +10,7 @@ #define STATIC #define INIT __init #define INITDATA __initdata +#define INITCONST __initconst =20 #define malloc xmalloc_bytes #define free xfree @@ -22,6 +23,7 @@ #define STATIC static #define INIT #define INITDATA +#define INITCONST =20 #define large_malloc malloc #define large_free free diff --git a/xen/common/xz/dec_bcj.c b/xen/common/xz/dec_bcj.c index 86c1192199..0a9a45de2b 100644 --- a/xen/common/xz/dec_bcj.c +++ b/xen/common/xz/dec_bcj.c @@ -87,10 +87,10 @@ static inline int INIT bcj_x86_test_msbyte(uint8_t b) =20 static size_t INIT bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size) { - static const bool_t mask_to_allowed_status[8] + static const bool_t INITCONST mask_to_allowed_status[8] =3D { true, true, true, false, true, false, false, false }; =20 - static const uint8_t mask_to_bit_num[8] =3D { 0, 1, 2, 2, 3, 3, 3, 3 }; + static const uint8_t INITCONST mask_to_bit_num[8] =3D { 0, 1, 2, 2, 3, 3,= 3, 3 }; =20 size_t i; size_t prev_pos =3D (size_t)-1; @@ -180,7 +180,7 @@ static size_t INIT bcj_powerpc(struct xz_dec_bcj *s, ui= nt8_t *buf, size_t size) #ifdef XZ_DEC_IA64 static size_t INIT bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t siz= e) { - static const uint8_t branch_table[32] =3D { + static const uint8_t INITCONST branch_table[32] =3D { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, 0, 7, 7, diff --git a/xen/common/xz/dec_stream.c b/xen/common/xz/dec_stream.c index b8b566307c..61eb2ffb55 100644 --- a/xen/common/xz/dec_stream.c +++ b/xen/common/xz/dec_stream.c @@ -138,7 +138,7 @@ struct xz_dec { =20 #ifdef XZ_DEC_ANY_CHECK /* Sizes of the Check field with different Check IDs */ -static const uint8_t check_sizes[16] =3D { +static const uint8_t INITCONST check_sizes[16] =3D { 0, 4, 4, 4, 8, 8, 8, --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 22:52:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560942274; cv=none; d=zoho.com; s=zohoarc; b=D6SOMyVHxt0D9gYxZcocNB+sFVw++LhYRwJmld8HQz0Zq0lgkw1qNyq5XIQHyBwByW96dotgST6TMf7jVMPc46CPVDbkTPK6HngNWPOTy8fXOrp5yIqyj0yp5NQU8HpCbQqXjXpad/hyMHkheE0eYgLAG4UuSyTXwQA5KkSbZBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560942274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=R1PxGnNSvUenQ1KK08JYuQTPGmceMJ785y9oP4zTWaE=; b=hPAwIS2BwcxKnEfI1smLWFalI/GAK6AjFDd+WrjhL4F1noqgH7qrWQSmP+63jKf9ZlisWBp4OsyVsWjqri38OTYTx0dhnAibicIeYH1DTI8rovMGoh9ekTeJ/ct84dFiv3USLA1evUF26qHLJBYcZO+5/zTpFW4YIb7SmAwgyTI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1560942274867476.7678949463834; Wed, 19 Jun 2019 04:04:34 -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 1hdYN3-0002Ex-Gh; Wed, 19 Jun 2019 11:03:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hdYN1-0002Ed-AN for xen-devel@lists.xenproject.org; Wed, 19 Jun 2019 11:03:15 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d5abb5b7-9281-11e9-8980-bc764e045a96; Wed, 19 Jun 2019 11:03:14 +0000 (UTC) X-Inumbo-ID: d5abb5b7-9281-11e9-8980-bc764e045a96 Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VYZNi5pZ5GedzBUYfRoB/U/UFai0d0AnDWXNaIa31JUrD8P02TdjHiifq3dM15nHAK0Kb3HjkY nQYyOBcQGHTeiXIDM/5tAZZyyVpubDAQN8VgWSNBga5QBCpN4td3PwYdRfK+oL3lgD6zH2hg1y sLcKsE40tN1bPFD//QIpAJBozQQsnOfweCBb/NB+XFU89xS3BNbtn8HiM4tvVuq6WQwiMnSc1+ UyatOMjDLUuhvprqooZ2YXDptyFCmy/Xj1PPMOAUNPzjsmxlkXaoyp6wCbz1HR4Ao2uGVESj/8 dDw= X-SBRS: 2.7 X-MesageID: 1926705 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,392,1557201600"; d="scan'208";a="1926705" From: Roger Pau Monne To: Date: Wed, 19 Jun 2019 13:02:48 +0200 Message-ID: <20190619110250.18881-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190619110250.18881-1-roger.pau@citrix.com> References: <20190619110250.18881-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/4] x86/linker: use DECL_SECTION uniformly 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: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Replace the two open-coded EFI related section declarations with the usage of DECL_SECTION. This is a preparatory change for also adding a reloc section to the ELF binary. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Andrew Cooper --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu --- xen/arch/x86/xen.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index cb42dc8fda..98a99444c2 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -298,12 +298,12 @@ SECTIONS =20 #ifdef EFI . =3D ALIGN(4); - .reloc : { + DECL_SECTION(.reloc) { *(.reloc) } :text /* Trick the linker into setting the image size to exactly 16Mb. */ . =3D ALIGN(__section_alignment__); - .pad : { + DECL_SECTION(.pad) { . =3D ALIGN(MB(16)); } :text #endif --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 22:52:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560942296; cv=none; d=zoho.com; s=zohoarc; b=oJpn1eHZCfmOTxvSnZ4FDDrpFBuuonTVEeHTV0L6eP5+tYUQksMvg31q5HAhlvQtf4Dciu1PeH6UpYAbmakJr8Tukgr3ThsoSRkyDzkmfflxq2ZR00vkQRZKiMkQ5V20aV+RRtqMxtgTph824JczRgLPJiKpyjWZD8xf6M4kEVM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560942296; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZjOVGpMPJWObNyNiymIB7LgGxhMov0U1t9GMGbDVhNA=; b=H5SvAAqDDFZt3+izPJ4bArHzAPShtBlNuPNpEchJj27wGKgrTl0qYDBW3kwrAgcrUuc3PoBbBjbq8m+iXZ9S6s/PS6V2OkSpWKix/+AicJVUdGBg7inPqwP3SSIZpDa4KEurVNa6BEZAZvo/wObTMNXtcEw7PPY2D5gdziLc65Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1560942296798332.61473574051206; Wed, 19 Jun 2019 04:04:56 -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 1hdYN7-0002GO-0M; Wed, 19 Jun 2019 11:03:21 +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 1hdYN6-0002G2-6B for xen-devel@lists.xenproject.org; Wed, 19 Jun 2019 11:03:20 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d6c7aa8a-9281-11e9-8b9e-e730fca96a68; Wed, 19 Jun 2019 11:03:16 +0000 (UTC) X-Inumbo-ID: d6c7aa8a-9281-11e9-8b9e-e730fca96a68 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: s3qYwPVAMhcqeCgfOHZXYkt2NTaHr+nc17sDNxcEnWQhYueJMlb8eJOpH0BFy0fM4aSPZYOgxZ NGHjQfWvKpfCdyuPXvPuU5UvThqHhAD9hirUFGbnseGdwwJSAHGT/26aUgz9MAjYZcuIhC+C2c JGpx47nMTbnUehUGiur7gy+01jqovJzo/cmzxUXbtO0CC1oU7sfRwuFqOG+qWTquXwux+uAS/i v8oIDvzbAeq2m6fZCWWHUpOHUAXoO16G9KTsB9+Eu79WsZ3L6xkvM/tjyNAHYTzZWqtBP45EU0 I38= X-SBRS: 2.7 X-MesageID: 1941203 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,392,1557201600"; d="scan'208";a="1941203" From: Roger Pau Monne To: Date: Wed, 19 Jun 2019 13:02:49 +0200 Message-ID: <20190619110250.18881-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190619110250.18881-1-roger.pau@citrix.com> References: <20190619110250.18881-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/4] x86/linker: add a reloc section to ELF binary 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: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" If the hypervisor has been built with EFI support (ie: multiboot2). This allows to position the .reloc section correctly in the output binary, or else the linker might place .reloc before the .text section. Note that the .reloc section is moved before .bss for two reasons: in order for the resulting binary to not contain any section with data after .bss, so that the file size can be smaller than the loaded memory size, and because the data it contains is read-only, so it belongs with the other sections containing read-only data. Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu --- xen/arch/x86/xen.lds.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 98a99444c2..82103ef1da 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -175,6 +175,14 @@ SECTIONS } :text #endif #endif + +#ifdef XEN_BUILD_EFI + . =3D ALIGN(4); + DECL_SECTION(.reloc) { + *(.reloc) + } :text +#endif + _erodata =3D .; =20 . =3D ALIGN(SECTION_ALIGN); @@ -297,10 +305,6 @@ SECTIONS __2M_rwdata_end =3D .; =20 #ifdef EFI - . =3D ALIGN(4); - DECL_SECTION(.reloc) { - *(.reloc) - } :text /* Trick the linker into setting the image size to exactly 16Mb. */ . =3D ALIGN(__section_alignment__); DECL_SECTION(.pad) { --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 22:52:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560942294; cv=none; d=zoho.com; s=zohoarc; b=KHB5tcI1eCFSURtaS8GuWqzJ1GNJsM8TfPuJ9aFKe1xou8V737w9WY5M/MDifRP3pcu+nDxLOKUH29ujBlS2/+abxOJR7aVDIwKORTxYxwqF8yehR+eqIiO3PT7yluJtUMxKJbeGwzapX24DUKJ6PVlo7BD9w/xAagHtz84J8as= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560942294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Ygjrb2VjEJ7RY0h3fNCghHT+I/OKohA1gQoTsGiG5SE=; b=CdyHVwugke6XhcV+WCfy+BuH1HRIcbtR2XAmBTIQW+BOwV9NH7d4jD2TsyChIusySpfK2IjCvPyyqXkf9McKFmIFPalgZOfARUsI16+xbJTmC7u71oPNISMnPLRfLlGpzA4s56CiyW0S6//etze09Hu1wqyqoeE5iqOA4rjyf90= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1560942294889821.7919291174005; Wed, 19 Jun 2019 04:04:54 -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 1hdYN9-0002HN-BL; Wed, 19 Jun 2019 11:03:23 +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 1hdYN7-0002Gp-W1 for xen-devel@lists.xenproject.org; Wed, 19 Jun 2019 11:03:22 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d7b3e56c-9281-11e9-a863-bf914ca9b8e8; Wed, 19 Jun 2019 11:03:18 +0000 (UTC) X-Inumbo-ID: d7b3e56c-9281-11e9-a863-bf914ca9b8e8 Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: m1ine1BMZyNHDKt8WR2ra+qRoQ/z82FizDvzpcM/g888PQCeqgZYz9fER0xkRr8zCJTLNY2v8+ w+w+gwBhWUeCAKFosx6KZykDDlJS4FelEfrLWOWtDM8ddFPC+KFFdXUYaUhiKp16Ba/9V8iJv9 jJApGjx4CU5EaoqYjPtvMJJTuBCVQRQ5Xk6unM/C8SgEVxN8JaFEvsoPnTAgcfR6AP+o6SvLZS AjuICfVRhRyfyAzqKy6tiQqmITVywjtzZ1LPhQlLhjz67bVGILJ7aUu0yb4HprZoE1HlDJvVGH oR4= X-SBRS: 2.7 X-MesageID: 1935696 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,392,1557201600"; d="scan'208";a="1935696" From: Roger Pau Monne To: Date: Wed, 19 Jun 2019 13:02:50 +0200 Message-ID: <20190619110250.18881-5-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190619110250.18881-1-roger.pau@citrix.com> References: <20190619110250.18881-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 4/4] x86: check for multiboot{1, 2} header presence 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: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" After building the hypervisor binary. Note that the check is performed by searching for the magic header value at the start of the binary. Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu --- xen/arch/x86/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 8a8d8f060f..9bb3bf6e6c 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -102,6 +102,9 @@ syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNIN= GS) :=3D $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) $(XEN_IMG_OFFSET) \ `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdat= a_end$$/0x\1/p'` + # Check for multiboot{1,2} headers + od -t x4 -N 8192 $(TARGET) | grep 1badb002 > /dev/null + od -t x4 -N 32768 $(TARGET) | grep e85250d6 > /dev/null =20 ALL_OBJS :=3D $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/= built_in.o $(ALL_OBJS) =20 --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel