llvm-gcc sometimes marks external declarations hidden, because intializers are

processed separately. Honour such situation and emit PIC relocations properly
in such case.

llvm-svn: 53091
This commit is contained in:
Anton Korobeynikov 2008-07-03 07:43:14 +00:00
parent a96eabaab7
commit 4827deb74f
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
// Extra load is needed for all externally visible.
if (isDirectCall)
return false;
if (GV->hasInternalLinkage() || GV->hasHiddenVisibility())
if (GV->hasInternalLinkage() ||
(GV->hasHiddenVisibility() && !GV->isDeclaration()))
return false;
return true;
} else if (isTargetCygMing() || isTargetWindows()) {