From 5d3d44a84815b848d4493f693a0579efcc2ce42f Mon Sep 17 00:00:00 2001 From: Lauro Ramos Venancio Date: Mon, 14 May 2007 23:20:21 +0000 Subject: [PATCH] Fix previous patch. GOTOFF can be used only when the symbol has internal 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 30b2a94bb0d..d059db1acfe 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -792,7 +792,7 @@ SDOperand ARMTargetLowering::LowerGlobalAddressELF(SDOperand Op, GlobalValue *GV = cast(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);