[llvm] r251342 - ARM/ELF: Restore original (pre-r251322) logic for deciding whether to use GOT.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 13:46:44 PDT 2015


Author: pcc
Date: Mon Oct 26 15:46:44 2015
New Revision: 251342

URL: http://llvm.org/viewvc/llvm-project?rev=251342&view=rev
Log:
ARM/ELF: Restore original (pre-r251322) logic for deciding whether to use GOT.

Unbreaks linking with gold, which cannot resolve direct relocations referring
to global symbols.

Modified:
    llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=251342&r1=251341&r2=251342&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 26 15:46:44 2015
@@ -2940,7 +2940,7 @@ bool ARMFastISel::tryToFoldLoadIntoMI(Ma
 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();

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=251342&r1=251341&r2=251342&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Oct 26 15:46:44 2015
@@ -2637,7 +2637,7 @@ SDValue ARMTargetLowering::LowerGlobalAd
   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>();




More information about the llvm-commits mailing list