ARM/ELF: Restore original (pre-r251322) logic for deciding whether to use GOT.
authorPeter Collingbourne <peter@pcc.me.uk>
Mon, 26 Oct 2015 20:46:44 +0000 (20:46 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 26 Oct 2015 20:46:44 +0000 (20:46 +0000)
Unbreaks linking with gold, which cannot resolve direct relocations referring
to global symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251342 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp
lib/Target/ARM/ARMISelLowering.cpp

index a2093ebb85dba7e500cbcd5e15a41deac3f6a1fd..175107450fc0a254ed2ece8d82111ea32b282e44 100644 (file)
@@ -2940,7 +2940,7 @@ bool ARMFastISel::tryToFoldLoadIntoMI(MachineInstr *MI, unsigned OpNo,
 unsigned ARMFastISel::ARMLowerPICELF(const GlobalValue *GV,
                                      unsigned Align, MVT VT) {
   bool UseGOT_PREL =
-      !(GV->hasHiddenVisibility() || GV->isStrongDefinitionForLinker());
+      !(GV->hasHiddenVisibility() || GV->hasLocalLinkage());
 
   LLVMContext *Context = &MF->getFunction()->getContext();
   unsigned ARMPCLabelIndex = AFI->createPICLabelUId();
index 36f8886ea0ed9a8ecc1fac6807f54288a4f20dad..49f8918b8ddd8d7523c1dc6923e3b3c679091139 100644 (file)
@@ -2637,7 +2637,7 @@ SDValue ARMTargetLowering::LowerGlobalAddressELF(SDValue Op,
   const GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
   if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
     bool UseGOT_PREL =
-        !(GV->hasHiddenVisibility() || GV->isStrongDefinitionForLinker());
+        !(GV->hasHiddenVisibility() || GV->hasLocalLinkage());
 
     MachineFunction &MF = DAG.getMachineFunction();
     ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();