[llvm] [PAC][CodeGen][ELF][AArch64] Support signed GOT (PR #96164)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 00:30:49 PDT 2024


================
@@ -82,6 +83,25 @@ static bool ShouldSignWithBKey(const Function &F, const AArch64Subtarget &STI) {
   return Key == "b_key";
 }
 
+static bool hasELFSignedGOTHelper(const Function &F,
+                                  const AArch64Subtarget *STI) {
+  if (!Triple(STI->getTargetTriple()).isOSBinFormatELF())
+    return false;
+  const Module *M = F.getParent();
+  uint64_t PAuthABIPlatform = -1;
+  if (const auto *PAP = mdconst::extract_or_null<ConstantInt>(
+          M->getModuleFlag("aarch64-elf-pauthabi-platform")))
+    PAuthABIPlatform = PAP->getZExtValue();
+  if (PAuthABIPlatform != ELF::AARCH64_PAUTH_PLATFORM_LLVM_LINUX)
+    return false;
----------------
kovdan01 wrote:

I agree, it's much better, thanks! Applied your suggestion in 4c85d6c31cfc89e8543d4f8d78c9cd82dd33ca37

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


More information about the llvm-commits mailing list