[clang] [llvm] [PAC][clang] Fix ptrauth module flags behavior (PR #204226)

Daniil Kovalev via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 7 04:52:45 PDT 2026


================
@@ -1481,14 +1481,18 @@ void CodeGenModule::Release() {
     if (!LangOpts.isSignReturnAddressWithAKey())
       getModule().addModuleFlag(llvm::Module::Min,
                                 "sign-return-address-with-bkey", 2);
-
-    if (LangOpts.PointerAuthELFGOT)
-      getModule().addModuleFlag(llvm::Module::Error, "ptrauth-elf-got", 1);
+  }
+  if (T.isAArch64()) {
+    if (getTriple().isOSBinFormatELF())
+      getModule().addModuleFlag(
+          llvm::Module::Error, "ptrauth-elf-got",
+          static_cast<uint32_t>(LangOpts.PointerAuthELFGOT));
----------------
kovdan01 wrote:

Applied suggestion, thanks! See 309be5aad918002cfcfdbc677ceafb7341c52e5f

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


More information about the cfe-commits mailing list