Enable PIC codegen on x86-64/linux
authorAnton Korobeynikov <asl@math.spbu.ru>
Sun, 20 Jan 2008 13:58:16 +0000 (13:58 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sun, 20 Jan 2008 13:58:16 +0000 (13:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46198 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86Subtarget.cpp

index 6efe540fabd24ea7f503dfdad91e4b04cc3db3ce..1480332ef0cc316bc730fa6855e89744609b8f1f 100644 (file)
@@ -41,7 +41,7 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
       return (!isDirectCall &&
               (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
                (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode())));
-    } else if (TM.getRelocationModel() == Reloc::PIC_ && isPICStyleGOT()) {
+    } else if (isTargetELF()) {
       // Extra load is needed for all non-statics.
       return (!isDirectCall &&
               (GV->isDeclaration() || !GV->hasInternalLinkage()));