summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7fa4fddc79e..9e42aa2750f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -746,9 +746,10 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
return false;
// If we can use copy relocations we can assume it is local.
- if (isa<VarDecl>(D) &&
- (RM == llvm::Reloc::Static || CGOpts.PIECopyRelocations))
- return true;
+ if (auto *VD = dyn_cast<VarDecl>(D))
+ if (VD->getTLSKind() == VarDecl::TLS_None &&
+ (RM == llvm::Reloc::Static || CGOpts.PIECopyRelocations))
+ return true;
// If we can use a plt entry as the symbol address we can assume it
// is local.
OpenPOWER on IntegriCloud