From nobody Mon Sep 16 19:46:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101935+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101935+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1679914926; cv=none; d=zohomail.com; s=zohoarc; b=UTcFYxtLvLuXIkQWHmkelnr5qql5o7yXYmlpWtV4/cN/uYwfKwxpXXhOC0678xYZMab6KZdL8UE5CLuNR1O1zy1ZB9GBQMv9rGpXVAZHS35MAg7JZB3FDvLH1kHM8jbnx7eKtSwOPwevw3QYDTNXKNHAQBrKEBnZip3ETjI98R4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679914926; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=MM5v1WQKfjjk2058lAcQHVSxAxmLZsBoair5u7UOPhc=; b=RoZAPY5KqkTzoNvE8XGet3/gjHRh6jAGC/41P3ZWh9m1xPQtwBJAoR+6RmbnapaZxLp6kkeMgnJhP4DZ42d6Uqsdm1JqG2XL4MZtbj/dbX4f2bOfDkQ4Pts1bqjrHJfJ6kKSumhlnfjTCmm4gnUS71LJFpxfsBPDj4Z76DN7SY8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101935+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167991492640093.09884268269946; Mon, 27 Mar 2023 04:02:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KbhsYY1788612xlhJGG15Oll; Mon, 27 Mar 2023 04:02:05 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.32022.1679914925268993792 for ; Mon, 27 Mar 2023 04:02:05 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD9E9611AC; Mon, 27 Mar 2023 11:02:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1B7CC433A0; Mon, 27 Mar 2023 11:02:01 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe , =?UTF-8?q?Marvin=20H=C3=A4user?= , Bob Feng Subject: [edk2-devel] [PATCH v2 11/17] ArmPkg, BaseTools AARCH64: Add BTI ELF note to .hii objects Date: Mon, 27 Mar 2023 13:01:06 +0200 Message-Id: <20230327110112.262503-12-ardb@kernel.org> In-Reply-To: <20230327110112.262503-1-ardb@kernel.org> References: <20230327110112.262503-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org X-Gm-Message-State: D8QJM6RxFoFfyHFlCPK0IIESx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1679914925; bh=XpNoIpNgLkFnAF/zPQWFA7ETVqo1YGkXTETeMHOckDM=; h=Cc:Date:From:Reply-To:Subject:To; b=cUmgaPZ1cGV3zIPbmAo5IFJCYEZqwL1u3yPE+2PupSFsKak/QP3ECbNZdu31jIgwkzt tUb3eZ126gHOfKvrMbH+QaF6x5r3Zm616ThiZFDwPoT/7CGsnsQXqAfs06cdipW18i+0r p/2vWaRBlzBGp2v+/5B554PRGS3XeAYFLiM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1679914927299100003 Content-Type: text/plain; charset="utf-8" The ELF based toolchains use objcopy to create HII object files, which contain only a single .hii section. This means no GNU note is inserted that describes the object as compatible with BTI, even though the lack of executable code in such an object makes the distinction irrelevant. However, the linker will not add the note globally to the resulting ELF executable, and this breaks BTI compatibility. So let's insert a GNU BTI-compatible ELF note by hand when generating such object files. Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/GnuNoteBti.bin | Bin 0 -> 32 bytes BaseTools/Conf/tools_def.template | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/GnuNoteBti.bin b/ArmPkg/Library/GnuNoteBti.bin new file mode 100644 index 0000000000000000000000000000000000000000..339567b4e89943c610b44767dda= d5f631229ed3b GIT binary patch literal 32 dcmZQ!U|