Select static relocation model if it is jitting.
authorAkira Hatanaka <ahatanaka@mips.com>
Sat, 31 Mar 2012 02:38:36 +0000 (02:38 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Sat, 31 Mar 2012 02:38:36 +0000 (02:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153795 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp

index 76526754be7d2a1a272e8026594ff2e258d81320..09964e55595e5e8b7eed5d4b5a79f8fbcb72f062 100644 (file)
@@ -67,7 +67,9 @@ static MCCodeGenInfo *createMipsMCCodeGenInfo(StringRef TT, Reloc::Model RM,
                                               CodeModel::Model CM,
                                               CodeGenOpt::Level OL) {
   MCCodeGenInfo *X = new MCCodeGenInfo();
-  if (RM == Reloc::Default)
+  if (CM == CodeModel::JITDefault)
+    RM = Reloc::Static;
+  else if (RM == Reloc::Default)
     RM = Reloc::PIC_;
   X->InitMCCodeGenInfo(RM, CM, OL);
   return X;