summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 06:25:51 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 06:25:51 +0000
commitcd2915e46769317c8e2393bb6d2a2aed58036f45 (patch)
tree507ecc4dfeadbe722963d069da86989b0ac3ab92 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parentab9cd3e132a86f99c8784c6025c6f55bb5cf2612 (diff)
downloadbcm5719-llvm-cd2915e46769317c8e2393bb6d2a2aed58036f45.tar.gz
bcm5719-llvm-cd2915e46769317c8e2393bb6d2a2aed58036f45.zip
stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive. Streamerize its generation. llvm-svn: 93868
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 77203e08382..01fb21756f5 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -761,16 +761,19 @@ void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
ConstDataCoalSection
= getMachOSection("__DATA","__const_coal", MCSectionMachO::S_COALESCED,
SectionKind::getText());
- DataCommonSection
- = getMachOSection("__DATA","__common", MCSectionMachO::S_ZEROFILL,
- SectionKind::getBSS());
ConstDataSection // .const_data
= getMachOSection("__DATA", "__const", 0,
SectionKind::getReadOnlyWithRel());
DataCoalSection
= getMachOSection("__DATA","__datacoal_nt", MCSectionMachO::S_COALESCED,
SectionKind::getDataRel());
-
+ DataCommonSection
+ = getMachOSection("__DATA","__common", MCSectionMachO::S_ZEROFILL,
+ SectionKind::getBSS());
+ DataBSSSection
+ = getMachOSection("__DATA","__bss", MCSectionMachO::S_ZEROFILL,
+ SectionKind::getBSS());
+
LazySymbolPointerSection
= getMachOSection("__DATA", "__la_symbol_ptr",
@@ -933,6 +936,11 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
// DATA, __common section with the .zerofill directive.
if (Kind.isBSSExtern())
return DataCommonSection;
+
+ // Put zero initialized globals with local linkage in __DATA,__bss directive
+ // with the .zerofill directive (aka .lcomm).
+ if (Kind.isBSSLocal())
+ return DataBSSSection;
// Otherwise, just drop the variable in the normal data section.
return DataSection;
OpenPOWER on IntegriCloud