Allow JIT with non-static relocation model.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 22 Dec 2007 01:12:14 +0000 (01:12 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 22 Dec 2007 01:12:14 +0000 (01:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45304 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetMachine.cpp

index f87640f224bf85c852175edf2a49b05ef12186a0..95dd32f42978c93bd95bd93e6ed069bb5d18245a 100644 (file)
@@ -170,7 +170,8 @@ bool X86TargetMachine::addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
 bool X86TargetMachine::addCodeEmitter(FunctionPassManager &PM, bool Fast,
                                       bool DumpAsm, MachineCodeEmitter &MCE) {
   // FIXME: Move this to TargetJITInfo!
-  setRelocationModel(Reloc::Static);
+  if (getRelocationModel() == Reloc::Default)
+    setRelocationModel(Reloc::Static);
   Subtarget.setPICStyle(PICStyle::None);
   
   // JIT cannot ensure globals are placed in the lower 4G of address.