aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-05-10 14:58:47 -0700
committerSam Clegg <sbc@chromium.org>2021-05-12 13:31:02 -0700
commit3041b16f7322a0392810e4a14b13cacac1929ad8 (patch)
treebee0267ddadb8cab67bf9d4cef100871f97fd9a1 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentba38b72ec2833bf8c54829a0fd7a8c968e6260d4 (diff)
downloadllvm-3041b16f7322a0392810e4a14b13cacac1929ad8.zip
llvm-3041b16f7322a0392810e4a14b13cacac1929ad8.tar.gz
llvm-3041b16f7322a0392810e4a14b13cacac1929ad8.tar.bz2
[WebAssembly] Add TLS data segment flag: WASM_SEG_FLAG_TLS
Previously the linker was relying solely on the name of the segment to imply TLS. Differential Revision: https://reviews.llvm.org/D102202
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 54d65cc..3112229 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -2009,11 +2009,14 @@ static const Comdat *getWasmComdat(const GlobalValue *GV) {
static unsigned getWasmSectionFlags(SectionKind K) {
unsigned Flags = 0;
- // TODO(sbc): Add suport for K.isMergeableConst()
+ if (K.isThreadLocal())
+ Flags |= wasm::WASM_SEG_FLAG_TLS;
if (K.isMergeableCString())
Flags |= wasm::WASM_SEG_FLAG_STRINGS;
+ // TODO(sbc): Add suport for K.isMergeableConst()
+
return Flags;
}