Skip to content

Commit

Permalink
[SSP] Restore setting the visibility of __guard_local to hidden for b…
Browse files Browse the repository at this point in the history
…etter code generation.

Patch by: Philip Guenther

(cherry picked from commit d870e36)
  • Loading branch information
brad0 authored and zmodem committed Aug 28, 2020
1 parent 22bce84 commit 97ac9e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/lib/CodeGen/TargetLoweringBase.cpp
Expand Up @@ -1827,7 +1827,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<> &IRB) const {
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
return M.getOrInsertGlobal("__guard_local", PtrTy);
Constant *C = M.getOrInsertGlobal("__guard_local", PtrTy);
if (GlobalVariable *G = dyn_cast_or_null<GlobalVariable>(C))
G->setVisibility(GlobalValue::HiddenVisibility);
return C;
}
return nullptr;
}
Expand Down

0 comments on commit 97ac9e8

Please sign in to comment.