aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-14 20:11:56 +0000
committerChris Lattner <sabre@nondot.org>2010-06-14 20:11:56 +0000
commit60ad7f2b58b2a8f9c1fc7063c940a0c073a32171 (patch)
tree3d2466c815b5d8e7d7317d94bb27e00edd1eddb7 /lib
parent1e6e610ac9e128500d777fc89bbf57c1202277ab (diff)
downloadexternal_llvm-60ad7f2b58b2a8f9c1fc7063c940a0c073a32171.zip
external_llvm-60ad7f2b58b2a8f9c1fc7063c940a0c073a32171.tar.gz
external_llvm-60ad7f2b58b2a8f9c1fc7063c940a0c073a32171.tar.bz2
fix a nasty bug where we were not treating available_externally
symbols as declarations in the X86 backend. This would manifest on darwin x86-32 as errors like this with -fvisibility=hidden: symbol '__ZNSbIcED1Ev' can not be undefined in a subtraction expression This fixes PR7353. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-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 4012b50..6eda20d 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -53,9 +53,12 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
if (GV->hasDLLImportLinkage())
return X86II::MO_DLLIMPORT;
- // Materializable GVs (in JIT lazy compilation mode) do not require an
- // extra load from stub.
- bool isDecl = GV->isDeclaration() && !GV->isMaterializable();
+ // Determine whether this is a reference to a definition or a declaration.
+ // Materializable GVs (in JIT lazy compilation mode) do not require an extra
+ // load from stub.
+ bool isDecl = GV->hasAvailableExternallyLinkage();
+ if (GV->isDeclaration() && !GV->isMaterializable())
+ isDecl = true;
// X86-64 in PIC mode.
if (isPICStyleRIPRel()) {