Fix previous patch. GOTOFF can be used only when the symbol has internal
authorLauro Ramos Venancio <lauro.venancio@gmail.com>
Mon, 14 May 2007 23:20:21 +0000 (23:20 +0000)
committerLauro Ramos Venancio <lauro.venancio@gmail.com>
Mon, 14 May 2007 23:20:21 +0000 (23:20 +0000)
linkage or hidden visibility.

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

lib/Target/ARM/ARMISelLowering.cpp

index 30b2a94bb0d0b6d4d0f8c945133665bc849e9874..d059db1acfe64453e26eaedf4cb88c726911c70b 100644 (file)
@@ -792,7 +792,7 @@ SDOperand ARMTargetLowering::LowerGlobalAddressELF(SDOperand Op,
   GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
   Reloc::Model RelocM = getTargetMachine().getRelocationModel();
   if (RelocM == Reloc::PIC_) {
-    bool UseGOTOFF = !GV->isDeclaration();
+    bool UseGOTOFF = GV->hasInternalLinkage() || GV->hasHiddenVisibility();
     ARMConstantPoolValue *CPV =
       new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT");
     SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2);