summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2017-01-20 23:18:39 +0000
committerguenther <guenther@openbsd.org>2017-01-20 23:18:39 +0000
commitaa9d6a08e9f5c6963f1f27aca24d483ba002f6a3 (patch)
tree014a979f53fe21b7e79f7cbfd84728f6d9a9ddde
parentUse a global variable PUB_KEY for the location of the key file. (diff)
downloadwireguard-openbsd-aa9d6a08e9f5c6963f1f27aca24d483ba002f6a3.tar.xz
wireguard-openbsd-aa9d6a08e9f5c6963f1f27aca24d483ba002f6a3.zip
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@
-rw-r--r--gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp5
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;
}