summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp12
-rw-r--r--llvm/test/CodeGen/X86/global-sections.ll7
2 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 07cf871cef6..7d9382e5233 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -524,14 +524,14 @@ const MCSection *TargetLoweringObjectFileMachO::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const {
if (Kind.isText())
- return GV->isWeakForLinker() ? TextCoalSection : TextSection;
-
- // If this is weak/linkonce, put this in a coalescable section, either in text
- // or data depending on if it is writable.
+ return TextSection;
+
+ // If this is weak/linkonce, put this in a read only or data section depending
+ // on whether or not it's writable.
if (GV->isWeakForLinker()) {
if (Kind.isReadOnly())
- return ConstTextCoalSection;
- return DataCoalSection;
+ return ReadOnlySection;
+ return DataSection;
}
// FIXME: Alignment check should be handled by section classifier.
diff --git a/llvm/test/CodeGen/X86/global-sections.ll b/llvm/test/CodeGen/X86/global-sections.ll
index 194f59765e5..b38aea4e7bb 100644
--- a/llvm/test/CodeGen/X86/global-sections.ll
+++ b/llvm/test/CodeGen/X86/global-sections.ll
@@ -20,7 +20,7 @@
; TODO: linux drops this into .rodata, we drop it into ".gnu.linkonce.r.G2"
-; DARWIN: .section __TEXT,__const_coal,coalesced
+; DARWIN: .section __TEXT,__const{{$}}
; DARWIN: _G2:
; DARWIN: .long 42
@@ -70,7 +70,6 @@
; LINUX: .weak foo_20_bar
; LINUX: foo_20_bar:
-; DARWIN: .section __DATA,__datacoal_nt,coalesced
; DARWIN: .globl "_foo bar"
; DARWIN: .weak_definition "_foo bar"
; DARWIN: "_foo bar":
@@ -85,7 +84,7 @@
; LINUX: .byte 1
; LINUX: .size G6, 1
-; DARWIN: .section __TEXT,__const_coal,coalesced
+; DARWIN: .section __TEXT,__const{{$}}
; DARWIN: .globl _G6
; DARWIN: .weak_definition _G6
; DARWIN:_G6:
@@ -131,7 +130,7 @@
@G10 = weak global [100 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=0]
-; DARWIN: .section __DATA,__datacoal_nt,coalesced
+; DARWIN: .section __DATA,__data{{$}}
; DARWIN: .globl _G10
; DARWIN: .weak_definition _G10
; DARWIN: .align 5
OpenPOWER on IntegriCloud