aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniil Kovalev <dkovalev@accesssoftek.com>2024-08-19 12:53:43 +0300
committerGitHub <noreply@github.com>2024-08-19 12:53:43 +0300
commitde5deb7b07db39810c4b07870c75ccc8dccc5fe9 (patch)
tree716e6aab29d2f49e08ef32db4a401fac9625465d /clang/lib/CodeGen/CodeGenModule.cpp
parent740f05545150fb01cfca8c16da50c956b4f30959 (diff)
downloadllvm-de5deb7b07db39810c4b07870c75ccc8dccc5fe9.zip
llvm-de5deb7b07db39810c4b07870c75ccc8dccc5fe9.tar.gz
llvm-de5deb7b07db39810c4b07870c75ccc8dccc5fe9.tar.bz2
[PAC][ELF][AArch64] Encode several ptrauth features in PAuth core info (#102508)
For llvm_linux platform, define the following meaning for bits 9, 10, 11: - bit 9: set if indirect gotos signing is enabled; - bit 10: set if type info vtable pointer discrimination is enabled; - bit 11: set if function pointer type discrimination is enabled.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 6d11bd1..0b61ef0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1220,8 +1220,14 @@ void CodeGenModule::Release() {
(LangOpts.PointerAuthInitFiniAddressDiscrimination
<< AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINIADDRDISC) |
(LangOpts.PointerAuthELFGOT
- << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOT);
- static_assert(AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOT ==
+ << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOT) |
+ (LangOpts.PointerAuthIndirectGotos
+ << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_GOTOS) |
+ (LangOpts.PointerAuthTypeInfoVTPtrDiscrimination
+ << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_TYPEINFOVPTRDISCR) |
+ (LangOpts.PointerAuthFunctionTypeDiscrimination
+ << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_FPTRTYPEDISCR);
+ static_assert(AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_FPTRTYPEDISCR ==
AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_LAST,
"Update when new enum items are defined");
if (PAuthABIVersion != 0) {