Skip to content

Commit 1c9461c

Browse files
tuliompradt2
authored andcommitted
[OpenMP][AArch64] Fix branch protection in microtasks (llvm#102317)
Start __kmp_invoke_microtask with PACBTI in order to identify the function as a valid branch target. Before returning, SP is authenticated. Also add the BTI and PAC markers to z_Linux_asm.S. With this patch, libomp.so can now be generated with DT_AARCH64_BTI_PLT when built with -mbranch-protection=standard. The implementation is based on the code available in compiler-rt. (cherry picked from commit 0aa22dc)
1 parent 5d8eadc commit 1c9461c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openmp/runtime/src/z_Linux_asm.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,3 +2517,7 @@ KMP_PREFIX_UNDERSCORE(__kmp_unnamed_critical_addr):
25172517
#if KMP_OS_LINUX && (KMP_ARCH_AARCH64 || KMP_ARCH_AARCH64_32)
25182518
GNU_PROPERTY_BTI_PAC
25192519
#endif
2520+
2521+
#if KMP_OS_LINUX && (KMP_ARCH_AARCH64 || KMP_ARCH_AARCH64_32)
2522+
GNU_PROPERTY_BTI_PAC
2523+
#endif

0 commit comments

Comments
 (0)