diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-16 01:23:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-16 01:23:26 +0000 |
commit | c0a7f1d4fcf58acc7b01366fb9219fb55a047bdb (patch) | |
tree | 14c913fda3bfc618bb8978ec381ce83a07b7ce82 /lib | |
parent | 46db8737ecf4bef3f57522959d62381e8fae63e6 (diff) | |
download | external_llvm-c0a7f1d4fcf58acc7b01366fb9219fb55a047bdb.zip external_llvm-c0a7f1d4fcf58acc7b01366fb9219fb55a047bdb.tar.gz external_llvm-c0a7f1d4fcf58acc7b01366fb9219fb55a047bdb.tar.bz2 |
fix section switching to ensure that stubs are emitted to the right
section on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 44b0d0c..b74321c 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -984,10 +984,10 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { // Output stubs for dynamically-linked functions if (TM.getRelocationModel() == Reloc::PIC_ && !FnStubs.empty()) { - SwitchToTextSection("\t.section __TEXT,__picsymbolstub1,symbol_stubs," - "pure_instructions,32"); for (StringMap<FnStubInfo>::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) { + SwitchToTextSection("\t.section __TEXT,__picsymbolstub1,symbol_stubs," + "pure_instructions,32"); EmitAlignment(4); const FnStubInfo &Info = I->second; O << Info.Stub << ":\n"; @@ -1003,16 +1003,17 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) { O << Info.LazyPtr << "-" << Info.AnonSymbol << ")(r11)\n"; O << "\tmtctr r12\n"; O << "\tbctr\n"; + SwitchToDataSection(".lazy_symbol_pointer"); O << Info.LazyPtr << ":\n"; O << "\t.indirect_symbol " << I->getKeyData() << '\n'; O << (isPPC64 ? "\t.quad" : "\t.long") << " dyld_stub_binding_helper\n"; } } else if (!FnStubs.empty()) { - SwitchToTextSection("\t.section __TEXT,__symbol_stub1,symbol_stubs," - "pure_instructions,16"); for (StringMap<FnStubInfo>::iterator I = FnStubs.begin(), E = FnStubs.end(); I != E; ++I) { + SwitchToTextSection("\t.section __TEXT,__symbol_stub1,symbol_stubs," + "pure_instructions,16"); EmitAlignment(4); const FnStubInfo &Info = I->second; O << Info.Stub << ":\n"; |