summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-08-07 21:13:06 +0000
committerEric Christopher <echristo@gmail.com>2013-08-07 21:13:06 +0000
commit10251753b6897adcd22cc981c0cc42f348c109de (patch)
treedfdb342d5f31bd6ebca834fdfea929fd0b16cb90 /lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent189f7983fb300357712689733f65dde9e3658a14 (diff)
downloadllvm-10251753b6897adcd22cc981c0cc42f348c109de.tar.gz
llvm-10251753b6897adcd22cc981c0cc42f348c109de.tar.bz2
llvm-10251753b6897adcd22cc981c0cc42f348c109de.tar.xz
Using the integrated assembler we'd fail to change section to the
.tbss section for zerofill thread locals. Make sure we do this before emitting the zerofills. Fixes PR15972. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 0c59286fa9..12c35747ee 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -368,9 +368,10 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
MCSymbol *MangSym =
OutContext.GetOrCreateSymbol(GVSym->getName() + Twine("$tlv$init"));
- if (GVKind.isThreadBSS())
+ if (GVKind.isThreadBSS()) {
+ TheSection = getObjFileLowering().getTLSBSSSection();
OutStreamer.EmitTBSSSymbol(TheSection, MangSym, Size, 1 << AlignLog);
- else if (GVKind.isThreadData()) {
+ } else if (GVKind.isThreadData()) {
OutStreamer.SwitchSection(TheSection);
EmitAlignment(AlignLog, GV);