From 3c8e147a6bb107eb7b5d5d71efc7880953d44f91 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 27 Nov 2013 15:52:11 +0000 Subject: Use the same tls section name as msvc. We currently error in clang with: "error: thread-local storage is unsupported for the current target", but we can start to get the llvm level ready. When compiling template struct foo { static __declspec(thread) int bar; }; template __declspec(therad) int foo::bar; template struct foo; msvc produces SECTION HEADER #3 .tls$ name 0 physical address 0 virtual address 4 size of raw data 12F file pointer to raw data (0000012F to 00000132) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers C0301040 flags Initialized Data COMDAT; sym= "public: static int foo::bar" (?bar@?$foo@H@@2HA) 4 byte align Read Write gcc produces a ".data$__emutls_v." for the testcase with __declspec(thread) replaced with thread_local. llvm-svn: 195849 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 229ccfae28a5..25d8cdc43994 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/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"; -- cgit v1.2.3