diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-20 23:18:40 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-01-20 23:18:40 +0000 |
commit | cbe8a7703b0c2cf36c6fe478d1ba3f7601e56698 (patch) | |
tree | c62977e3fe730cabda7391fc9fd88899c9c441ef /gnu/llvm | |
parent | b627fa150079a26b85bc1b7404bed65e589350b9 (diff) |
Restore setting the visibility of __guard_local to hidden for better
code generation. Use dyn_case_or_null instead of a static cast to
solve the crashes in the previous code.
ok stefan@ kettenis@
Diffstat (limited to 'gnu/llvm')
-rw-r--r-- | gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp b/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp index 8ca2bf9e86d..dc01d160e10 100644 --- a/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1818,7 +1818,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; } |