aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniil Kovalev <dkovalev@accesssoftek.com>2024-08-06 18:24:01 +0300
committerGitHub <noreply@github.com>2024-08-06 18:24:01 +0300
commit15d4a84e7977725dc0661995963a12ff8605b03c (patch)
tree931abb46a35401874fc1d235fd8dad2ab4310c97 /clang/lib/CodeGen/CodeGenModule.cpp
parent9684c87d1402ea9327c1abd7f56bafed8e751f51 (diff)
downloadllvm-15d4a84e7977725dc0661995963a12ff8605b03c.zip
llvm-15d4a84e7977725dc0661995963a12ff8605b03c.tar.gz
llvm-15d4a84e7977725dc0661995963a12ff8605b03c.tar.bz2
[PAC][ELF][AArch64] Encode signed GOT flag in PAuth core info (#96159)
Treat 8th bit of version value for llvm_linux platform as signed GOT flag. - clang: define `PointerAuthELFGOT` LangOption and set 8th bit of `aarch64-elf-pauthabi-version` LLVM module flag correspondingly; - llvm-readobj: print `PointerAuthELFGOT` or `!PointerAuthELFGOT` in version description of llvm_linux platform depending on whether the flag is set.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 50484a0..9aaf90c 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1218,11 +1218,12 @@ void CodeGenModule::Release() {
(LangOpts.PointerAuthInitFini
<< AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINI) |
(LangOpts.PointerAuthInitFiniAddressDiscrimination
- << AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINIADDRDISC);
- static_assert(
- AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_INITFINIADDRDISC ==
- AARCH64_PAUTH_PLATFORM_LLVM_LINUX_VERSION_LAST,
- "Update when new enum items are defined");
+ << 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_LAST,
+ "Update when new enum items are defined");
if (PAuthABIVersion != 0) {
getModule().addModuleFlag(llvm::Module::Error,
"aarch64-elf-pauthabi-platform",