diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-10-09 03:01:19 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-10-09 03:01:19 +0000 |
commit | 35d86e60b6db89ad34dd15e90fa410fc43a26be5 (patch) | |
tree | 7a8c2332105f7705416f28e886042f5e39c1d3ce /llvm/lib/Target/Mips/MipsTargetMachine.cpp | |
parent | 5cef9cfd095800da95343abcd65dae9ddd20d1dd (diff) | |
download | bcm5719-llvm-35d86e60b6db89ad34dd15e90fa410fc43a26be5.tar.gz bcm5719-llvm-35d86e60b6db89ad34dd15e90fa410fc43a26be5.zip |
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)
llvm-svn: 42779
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetMachine.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index 372e267d462..64516594f66 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/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:: |