summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/ArmSvcLib
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-03-27 12:10:06 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-30 11:05:22 +0000
commit48d642a310b96e68465d724644510d3f6e381b2c (patch)
tree1eb1294c05bda88363e075964e00f0c1873d7d0a /ArmPkg/Library/ArmSvcLib
parentf8b1854b92559ad28dc6df6bb886652b87e2a422 (diff)
downloadedk2-48d642a310b96e68465d724644510d3f6e381b2c.tar.gz
edk2-48d642a310b96e68465d724644510d3f6e381b2c.tar.bz2
edk2-48d642a310b96e68465d724644510d3f6e381b2c.zip
ArmPkg: Emit BTI opcodes when BTI codegen is enabled
When building with -mbranch-protection=bti, which affects the compiler codegen only, ensure that the assembler based codegen is aligned with this, by emitting the BTI C opcode at the start of each exported function. While most exported functions are not in fact ever called indirectly, whether or not this is the case is a property of the caller so annotating every exported function is a reasonable default. While at it, fix two occurrences in ArmPkg of exported functions that did not use the ASM_FUNC() macro. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
Diffstat (limited to 'ArmPkg/Library/ArmSvcLib')
-rw-r--r--ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S6
1 files changed, 3 insertions, 3 deletions
diff --git a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S
index 1a7c10cb79..bdba9d7fe9 100644
--- a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S
+++ b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S
@@ -5,12 +5,12 @@
//
//
+#include <AsmMacroIoLibV8.h>
+
.text
.align 3
-GCC_ASM_EXPORT(ArmCallSvc)
-
-ASM_PFX(ArmCallSvc):
+ASM_FUNC(ArmCallSvc)
// Push frame pointer and return address on the stack
stp x29, x30, [sp, #-32]!
mov x29, sp