From 3b4d1b38eac0542c8942dd114a6600d31aec503d Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <ardb@kernel.org>
Date: Thu, 30 Mar 2023 09:16:19 +0200
Subject: [PATCH] ArmVirtPkg/ArmPlatformLibQemu: Make IdMap.S BTI compatible

The IdMap.S asm source file has not executable content, but its lack of
a BTI annotation prevents the linker from marking any executables it
emits as BTI compatible if this object is part of the build. So add the
BTI note by hand.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S b/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
index 584ffcb3eb..ba65809e7f 100644
--- a/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
+++ b/ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S
@@ -57,3 +57,5 @@ idmap:      /* level 0 */
   .quad     PAGE_XIP | (idx << 12)        // 2044 KiB of R-X flash mappings
   .set      idx, idx + 1
   .endr
+
+AARCH64_BTI_NOTE()