diff options
-rw-r--r-- | lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 | ||||
-rw-r--r-- | test/MC/COFF/weak-symbol.ll | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 229ccfae28..25d8cdc439 100644 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -744,7 +744,7 @@ static const char *getCOFFSectionNameForUniqueGlobal(SectionKind Kind) { if (Kind.isBSS ()) return ".bss"; if (Kind.isThreadLocal()) - return ".tls"; + return ".tls$"; if (Kind.isWriteable()) return ".data"; return ".rdata"; diff --git a/test/MC/COFF/weak-symbol.ll b/test/MC/COFF/weak-symbol.ll index f23063e59c..c06692ed90 100644 --- a/test/MC/COFF/weak-symbol.ll +++ b/test/MC/COFF/weak-symbol.ll @@ -36,3 +36,13 @@ define weak void @f() section ".sect" { ; X64: .globl a
; X64: .zero 12
@a = weak unnamed_addr constant { i32, i32, i32 } { i32 0, i32 0, i32 0}, section ".data"
+
+; X86: .section .tls$,"w",discard,_b
+; X86: .globl _b
+; X86: .long 0
+;
+; X64: .section .tls$,"w",discard,b
+; X64: .globl b
+; X64: .long 0
+
+@b = weak_odr thread_local global i32 0, align 4
|