diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-15 01:45:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-15 01:45:01 +0000 |
commit | 2c3d3d2a59e8c241de43a7c50272ab6443794a19 (patch) | |
tree | a295594a5fb8fd2ef8487f3c8470e9e370c648de /lib/Target/PowerPC/PPCAsmPrinter.cpp | |
parent | d358cfc1bf2292922672ac35d4e897fe07de4785 (diff) |
Make sure to use SwitchSection to switch sections so that we don't accidentally emit
functions into the .const section. Whoops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 4b1404b202..fd3c13ed69 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -437,7 +437,7 @@ void DarwinAsmPrinter::printConstantPool(MachineConstantPool *MCP) { if (CP.empty()) return; for (unsigned i = 0, e = CP.size(); i != e; ++i) { - O << "\t.const\n"; + SwitchSection(".const", 0); // FIXME: force doubles to be naturally aligned. We should handle this // more correctly in the future. if (Type::DoubleTy == CP[i]->getType()) @@ -487,6 +487,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { } else { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: + SwitchSection("", 0); O << ".section __TEXT,__textcoal_nt,coalesced,no_toc\n" << ".weak_definition " << name << '\n' << ".private_extern " << name << '\n' @@ -649,7 +650,7 @@ void AIXAsmPrinter::printConstantPool(MachineConstantPool *MCP) { if (CP.empty()) return; for (unsigned i = 0, e = CP.size(); i != e; ++i) { - O << "\t.const\n"; + SwitchSection(".const", 0); O << "\t.align " << (unsigned)TD.getTypeAlignment(CP[i]->getType()) << "\n"; O << "LCPI" << FunctionNumber << '_' << i << ":\t\t\t\t\t;" |