From: Chris Lattner Date: Tue, 28 Jul 2009 17:57:51 +0000 (+0000) Subject: Fix PR4639, a ELF-TLS regression from some of my refactoring. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bf15e433b9ac6692e76aff0465cd93bb87f68989;p=oota-llvm.git Fix PR4639, a ELF-TLS regression from some of my refactoring. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77336 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp index 2074b6c5d69..7bd67885b2e 100644 --- a/lib/Target/TargetLoweringObjectFile.cpp +++ b/lib/Target/TargetLoweringObjectFile.cpp @@ -354,7 +354,7 @@ getSectionFlagsAsString(SectionKind Kind, SmallVectorImpl &Str) const { Str.push_back('@'); const char *KindStr; - if (Kind.isBSS()) + if (Kind.isBSS() || Kind.isThreadBSS()) KindStr = "nobits"; else KindStr = "progbits"; diff --git a/test/CodeGen/X86/global-sections-tls.ll b/test/CodeGen/X86/global-sections-tls.ll new file mode 100644 index 00000000000..a80cf327c0f --- /dev/null +++ b/test/CodeGen/X86/global-sections-tls.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX + +; PR4639 +@G1 = internal thread_local global i32 0 ; [#uses=1] +; LINUX: .section .tbss,"awT",@nobits +; LINUX: G1: + + +define i32* @foo() nounwind readnone { +entry: + ret i32* @G1 +} + +