mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Re-did 60519. It turns out Darwin's handling of hidden visibility symbols are a bit more complicate than I expected. Both declarations and weak definitions still need a stub indirection. However, the stubs are in data section and they contain the addresses of the actual symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60571 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -141,8 +141,11 @@ bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const {
|
||||
// We never hae stubs if HasLazyResolverStubs=false or if in static mode.
|
||||
if (!HasLazyResolverStubs || TM.getRelocationModel() == Reloc::Static)
|
||||
return false;
|
||||
|
||||
// If symbol visibility is hidden, the extra load is not needed if
|
||||
// the symbol is definitely defined in the current translation unit.
|
||||
bool isDecl = GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode();
|
||||
if (GV->hasHiddenVisibility() && !isDecl && !GV->hasCommonLinkage())
|
||||
return false;
|
||||
return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
|
||||
GV->hasCommonLinkage() ||
|
||||
(GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode());
|
||||
GV->hasCommonLinkage() || isDecl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user