aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorAlfredo Dal'Ava Junior <alfredo.junior@eldorado.org.br>2021-11-05 07:23:24 -0500
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2021-11-05 07:29:50 -0500
commit1cb9f37a17ab528e53d38c790c1bc44a087d2a50 (patch)
treeded282b2a214d312408d110f7e70df07495ccd35 /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent13a442ca494dcd177e8ea134e4f713c90f71bd42 (diff)
downloadllvm-1cb9f37a17ab528e53d38c790c1bc44a087d2a50.zip
llvm-1cb9f37a17ab528e53d38c790c1bc44a087d2a50.tar.gz
llvm-1cb9f37a17ab528e53d38c790c1bc44a087d2a50.tar.bz2
[FreeBSD] Do not mark __stack_chk_guard as dso_local
This symbol is defined in libc.so so it is definitely not DSO-Local. Marking it as such causes problems on some platforms (such as PowerPC). Differential revision: https://reviews.llvm.org/D109090
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 811d208..0dd45be 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1987,8 +1987,11 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
auto *GV = new GlobalVariable(M, Type::getInt8PtrTy(M.getContext()), false,
GlobalVariable::ExternalLinkage, nullptr,
"__stack_chk_guard");
+
+ // FreeBSD has "__stack_chk_guard" defined externally on libc.so
if (TM.getRelocationModel() == Reloc::Static &&
- !TM.getTargetTriple().isWindowsGNUEnvironment())
+ !TM.getTargetTriple().isWindowsGNUEnvironment() &&
+ !TM.getTargetTriple().isOSFreeBSD())
GV->setDSOLocal(true);
}
}