summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-05-24 00:10:20 +0000
committerDale Johannesen <dalej@apple.com>2008-05-24 00:10:20 +0000
commit18cc4d3ea4f9c86e1e0ce67cefb1f2e23d0619f2 (patch)
tree818ba5caf9071365c45fc1ea1a4329a3b287d0aa /llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
parent8647b875cc7a8b351fb90327b3bc602f864ea942 (diff)
downloadbcm5719-llvm-18cc4d3ea4f9c86e1e0ce67cefb1f2e23d0619f2.tar.gz
bcm5719-llvm-18cc4d3ea4f9c86e1e0ce67cefb1f2e23d0619f2.zip
Put initialized const weak objects into correct
sections on ppc32 darwin. g++.dg/abi/key2.C llvm-svn: 51527
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 75bf3b36e3f..9c9dd391be7 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -977,7 +977,15 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
case GlobalValue::CommonLinkage:
O << "\t.globl " << name << '\n'
<< "\t.weak_definition " << name << '\n';
- SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
+ if (!I->isConstant())
+ SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
+ else {
+ const ArrayType *AT = dyn_cast<ArrayType>(Type);
+ if (AT && AT->getElementType()==Type::Int8Ty)
+ SwitchToDataSection("\t.section __TEXT,__const_coal,coalesced", I);
+ else
+ SwitchToDataSection("\t.section __DATA,__const_coal,coalesced", I);
+ }
break;
case GlobalValue::AppendingLinkage:
// FIXME: appending linkage variables should go into a section of
OpenPOWER on IntegriCloud