Fix PR1761 by not printing (rip) suffix when in -static mode.
[oota-llvm.git] / lib / Target / X86 / X86ATTAsmPrinter.cpp
index cc4252fc47c23aeda7873a3fe7bdc4f33f7641eb..d8046edc89cd8d2d1a873ee23957c51e6f3f678f 100644 (file)
@@ -361,7 +361,8 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
           O << "@GOT";
         else
           O << "@GOTOFF";
-      } else if (Subtarget->isPICStyleRIPRel() && !NotRIPRel) {
+      } else if (Subtarget->isPICStyleRIPRel() && !NotRIPRel &&
+                 TM.getRelocationModel() != Reloc::Static) {
         if ((GV->isDeclaration() ||
              GV->hasWeakLinkage() ||
              GV->hasLinkOnceLinkage()) &&