diff options
author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-05-14 18:46:23 +0000 |
---|---|---|
committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-05-14 18:46:23 +0000 |
commit | 930d161ba23c9bd9e7dc9586742725b08a8e622d (patch) | |
tree | 0e890d324b620131144d19e5cf980c40fab86891 | |
parent | 69642f11ed9443a0ad9c6d959739bfcbdd4f732b (diff) |
Optimize PIC implementation. GOTOFF can be used when the symbol is defined
and used in the same module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37044 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 34ea98c0b9..30b2a94bb0 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<GlobalAddressSDNode>(Op)->getGlobal(); Reloc::Model RelocM = getTargetMachine().getRelocationModel(); if (RelocM == Reloc::PIC_) { - bool UseGOTOFF = GV->hasInternalLinkage(); + bool UseGOTOFF = !GV->isDeclaration(); ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT"); SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); |