From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ehJwrVmk; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) 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) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1B7CC433A0; Mon, 27 Mar 2023 11:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679914924; bh=baYBfhvUY3OKSHGbOTg7GDgM0SwD2vuViiLa7pxgYW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ehJwrVmkb+NHbceWg4wpgcZpDLoTmf7kME+kRGtAHOHGreg0mulVsq8E0FwU3prl1 QFOv17V0315sBYYQTcTYGm19/8xqGkbOuwrUbAM/g5oIO+tf4woYYXc6KzuZtLv3MT d1v9fqshDfb2bXcjLtxwa3b2VwxOu/Z6NNXy9AYXEXaMFY0y3LFQNo+sTrdGYnH0iE Gg7wYvKUS77Bp5BuJfWwl1LPNf452lfOguZpN1xZeYlbIjYDJAIJ6bbl9swbVPnBXb zooLB3D0sb5oeXR2Z9rTC1mU36oDWfL/cqtBol05eS+1fiENkkKz3qXxPglqqRWou4 cWhaIOTVfIH6g== 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: [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> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230327110112.262503-1-ardb@kernel.org> References: <20230327110112.262503-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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|