diff options
author | Tomas Matheson <tomas.matheson@arm.com> | 2023-06-16 11:10:37 +0100 |
---|---|---|
committer | Tomas Matheson <tomas.matheson@arm.com> | 2023-12-21 14:18:33 +0000 |
commit | 5992ce90b8c0fac06436c3c86621fbf6d5398ee5 (patch) | |
tree | 867f837ef0a3232c2cd21c59553e3b41c330b957 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 934b1099cbf14fa3f86a269dff957da8e5fb619f (diff) | |
download | llvm-5992ce90b8c0fac06436c3c86621fbf6d5398ee5.zip llvm-5992ce90b8c0fac06436c3c86621fbf6d5398ee5.tar.gz llvm-5992ce90b8c0fac06436c3c86621fbf6d5398ee5.tar.bz2 |
[AArch64] Codegen support for FEAT_PAuthLR
- Adds a new +pc option to -mbranch-protection that will enable
the use of PC as a diversifier in PAC branch protection code.
- When +pauth-lr is enabled (-march=armv9.5a+pauth-lr) in combination
with -mbranch-protection=pac-ret+pc, the new 9.5-a instructions
(pacibsppc, retaasppc, etc) are used.
Documentation for the relevant instructions can be found here:
https://developer.arm.com/documentation/ddi0602/2023-09/Base-Instructions/
Co-authored-by: Lucas Prates <lucas.prates@arm.com>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b2e173d0..d78f259 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1106,6 +1106,9 @@ void CodeGenModule::Release() { if (LangOpts.BranchTargetEnforcement) getModule().addModuleFlag(llvm::Module::Min, "branch-target-enforcement", 1); + if (LangOpts.BranchProtectionPAuthLR) + getModule().addModuleFlag(llvm::Module::Min, "branch-protection-pauth-lr", + 1); if (LangOpts.hasSignReturnAddress()) getModule().addModuleFlag(llvm::Module::Min, "sign-return-address", 1); if (LangOpts.isSignReturnAddressScopeAll()) |