[Openmp-commits] [openmp] [OpenMP][AArch64] Fix branch protection in microtasks (PR #102317)

Florian Weimer via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 9 07:52:41 PDT 2024


================
@@ -176,6 +197,25 @@ KMP_PREFIX_UNDERSCORE(\proc):
 .endm
 # endif // KMP_OS_DARWIN
 
+# if defined(__ARM_FEATURE_BTI_DEFAULT)
+#  define BTI_FLAG GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+# else
+#  define BTI_FLAG 0
+# endif
+# if __ARM_FEATURE_PAC_DEFAULT & 3
+#  define PAC_FLAG GNU_PROPERTY_AARCH64_FEATURE_1_PAC
+# else
+#  define PAC_FLAG 0
+# endif
+
+# if (BTI_FLAG | PAC_FLAG) != 0
+#  define BTI_C hint #34
+#  define GNU_PROPERTY_BTI_PAC \
+    GNU_PROPERTY(GNU_PROPERTY_AARCH64_FEATURE_1_AND, BTI_FLAG | PAC_FLAG)
+# else
+#  define BTI_C
----------------
fweimer-rh wrote:

Shouldn't you use `paciasp` here to protect the link register value while it's on the stack?

https://github.com/llvm/llvm-project/pull/102317


More information about the Openmp-commits mailing list