[clang] [AArch64][FMV] Enable PAuth and BTI hardening of resolver functions (PR #141573)

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 15 03:26:44 PDT 2025


================
@@ -4652,6 +4659,7 @@ llvm::Constant *CodeGenModule::GetOrCreateMultiVersionResolver(GlobalDecl GD) {
                                   "", Resolver, &getModule());
     GIF->setName(ResolverName);
     SetCommonAttributes(FD, GIF);
+    SetResolverAttrs(cast<llvm::Function>(Resolver));
----------------
labrinea wrote:

However at this point, the IFUNC resolver is just a declaration. We should perhaps call `setCommonAttributes` and `getTargetCodeGenInfo().setTargetAttributes` right after the invokation of `EmitMultiVersionResolver`where the actual definition of the resolver function is emitted. I've just tried this and the resolver is indeed marked "hidden" with -fvisibility=hidden.

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


More information about the cfe-commits mailing list