aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2008-06-02 07:52:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2008-06-02 07:52:43 +0000
commitda5860fa8b8ad7f8622fc096a55d68a140c7c3ac (patch)
tree94c7ea33c945b757669194b26a338af247e592e4 /lib/Target/X86/X86Subtarget.cpp
parent833f25d79ee28f1049f9177c3d2f4c9fbad6f643 (diff)
Don't use the GOT for symbols that are not externally visible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 23ceb9ba96..b4c5849696 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -44,9 +44,12 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
GV->hasCommonLinkage() ||
(GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode())));
} else if (isTargetELF()) {
- // Extra load is needed for all non-statics.
- return (!isDirectCall &&
- (GV->isDeclaration() || !GV->hasInternalLinkage()));
+ // Extra load is needed for all externally visible.
+ if (isDirectCall)
+ return false;
+ if (GV->hasInternalLinkage() || GV->hasHiddenVisibility())
+ return false;
+ return true;
} else if (isTargetCygMing() || isTargetWindows()) {
return (GV->hasDLLImportLinkage());
}