diff options
author | Daniel Kiss <daniel.kiss@arm.com> | 2023-08-14 20:53:31 +0200 |
---|---|---|
committer | Daniel Kiss <daniel.kiss@arm.com> | 2023-08-14 20:56:55 +0200 |
commit | 1ef3de6b09f6b21a383fc7cf1ce1283df738015a (patch) | |
tree | 3ba2dedd15a7019238373eafdae44d55d27706ae /clang/lib | |
parent | f7eb5222acd9f1296d2172dcbf1153082940092c (diff) | |
download | llvm-1ef3de6b09f6b21a383fc7cf1ce1283df738015a.zip llvm-1ef3de6b09f6b21a383fc7cf1ce1283df738015a.tar.gz llvm-1ef3de6b09f6b21a383fc7cf1ce1283df738015a.tar.bz2 |
Disable sanitizer's on ifunc resolvers.
Resolvers are running before the module is initialised which leads to
crashes due to the santizer is not yet initialised.
Fixes #40287
Reviewed By: hctim
Differential Revision: https://reviews.llvm.org/D150262
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 1c48d3b..3a79dec 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -5832,7 +5832,9 @@ void CodeGenModule::emitIFuncDefinition(GlobalDecl GD) { Entry->eraseFromParent(); } else GIF->setName(MangledName); - + if (auto *F = dyn_cast<llvm::Function>(Resolver)) { + F->addFnAttr(llvm::Attribute::DisableSanitizerInstrumentation); + } SetCommonAttributes(GD, GIF); } |