]> granicus.if.org Git - llvm/commitdiff
[PPC] Secure PLT only has meaning for PIC
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 28 Feb 2019 23:33:09 +0000 (23:33 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 28 Feb 2019 23:33:09 +0000 (23:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355154 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelDAGToDAG.cpp

index e28f4a7690e0b65246e564f4ec6c94bb76456fc0..08a5003e6973ce5727d3919679c0583bc24c32e5 100644 (file)
@@ -4358,8 +4358,8 @@ void PPCDAGToDAGISel::Select(SDNode *N) {
     const Module *M = MF->getFunction().getParent();
 
     if (PPCLowering->getPointerTy(CurDAG->getDataLayout()) != MVT::i32 ||
-        !PPCSubTarget->isSecurePlt() || !PPCSubTarget->isTargetELF() ||
-        M->getPICLevel() == PICLevel::SmallPIC)
+        (!TM.isPositionIndependent() || !PPCSubTarget->isSecurePlt()) ||
+        !PPCSubTarget->isTargetELF() || M->getPICLevel() == PICLevel::SmallPIC)
       break;
 
     SDValue Op = N->getOperand(1);