diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-02-22 20:19:42 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-02-22 20:19:42 +0000 |
| commit | 4c1aa866578f7a358407a22fe55b454f52a24325 (patch) | |
| tree | f5c6f24b1fedfb42a7024b7ba4c0aa5f21280c8b /lib/Target/PowerPC/PPCAsmPrinter.cpp | |
| parent | 0420f2aaf9551a10e2060d076de2fcdd7b316370 (diff) | |
- Added option -relocation-model to set relocation model. Valid values include static, pic,
dynamic-no-pic, and default.
PPC and x86 default is dynamic-no-pic for Darwin, pic for others.
- Removed options -enable-pic and -ppc-static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index bc19f1659d..714a36d1e7 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -132,7 +132,7 @@ namespace { } void printCallOperand(const MachineInstr *MI, unsigned OpNo) { const MachineOperand &MO = MI->getOperand(OpNo); - if (!PPCGenerateStaticCode) { + if (TM.getRelocationModel() != Reloc::Static) { if (MO.getType() == MachineOperand::MO_GlobalAddress) { GlobalValue *GV = MO.getGlobal(); if (((GV->isExternal() || GV->hasWeakLinkage() || @@ -167,7 +167,7 @@ namespace { } else { O << "ha16("; printOp(MI->getOperand(OpNo)); - if (PICEnabled) + if (TM.getRelocationModel() == Reloc::PIC) O << "-\"L" << getFunctionNumber() << "$pb\")"; else O << ')'; @@ -179,7 +179,7 @@ namespace { } else { O << "lo16("; printOp(MI->getOperand(OpNo)); - if (PICEnabled) + if (TM.getRelocationModel() == Reloc::PIC) O << "-\"L" << getFunctionNumber() << "$pb\")"; else O << ')'; @@ -362,7 +362,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) { return; case MachineOperand::MO_ExternalSymbol: // Computing the address of an external symbol, not calling it. - if (!PPCGenerateStaticCode) { + if (TM.getRelocationModel() != Reloc::Static) { std::string Name(GlobalPrefix); Name += MO.getSymbolName(); GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; @@ -377,7 +377,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) { int offset = MO.getOffset(); // External or weakly linked global variables need non-lazily-resolved stubs - if (!PPCGenerateStaticCode) { + if (TM.getRelocationModel() != Reloc::Static) { if (((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()))) { GVStubs.insert(Name); @@ -585,7 +585,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { } // Output stubs for dynamically-linked functions - if (PICEnabled) { + if (TM.getRelocationModel() == Reloc::PIC) { for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end(); i != e; ++i) { SwitchSection(".section __TEXT,__picsymbolstub1,symbol_stubs," |
