aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsTargetMachine.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-10-09 03:01:19 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-10-09 03:01:19 +0000
commit0a6040063fd9419041a81ada8f75b389381eb6b9 (patch)
treef96bfd9537505a69ca0bf1f817f71074d7ba0675 /lib/Target/Mips/MipsTargetMachine.cpp
parente78080c4dc1942fe8e2a1f28a280903868282e48 (diff)
Position Independent Code (PIC) support [2]
- Added a function to hold the stack location where GP must be stored during LowerCALL - AsmPrinter now emits directives based on relocation type - PIC_ set to default relocation type (same as GCC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r--lib/Target/Mips/MipsTargetMachine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index 372e267d46..64516594f6 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -39,7 +39,11 @@ MipsTargetMachine::
MipsTargetMachine(const Module &M, const std::string &FS):
Subtarget(*this, M, FS), DataLayout("E-p:32:32:32"),
InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0),
- TLInfo(*this) {}
+ TLInfo(*this)
+{
+ if (getRelocationModel() != Reloc::Static)
+ setRelocationModel(Reloc::PIC_);
+}
// return 0 and must specify -march to gen MIPS code.
unsigned MipsTargetMachine::