mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 14:10:58 +00:00
Add an explanation on how mips is special in here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8430ca2f8f
commit
706f4ac5f6
@ -1764,6 +1764,17 @@ SDValue MipsTargetLowering::lowerGlobalAddress(SDValue Op,
|
|||||||
return getAddrNonPIC(N, SDLoc(N), Ty, DAG);
|
return getAddrNonPIC(N, SDLoc(N), Ty, DAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Every other architecture would use shouldAssumeDSOLocal in here, but
|
||||||
|
// mips is special.
|
||||||
|
// * In PIC code mips requires got loads oven for local statics!
|
||||||
|
// * To save on got entries, for local statics the got entry contains the
|
||||||
|
// page and an additional add instruction takes care of the low bits.
|
||||||
|
// * It is legal to access a hidden symbol with a non hidden undefined,
|
||||||
|
// so one cannot guarantee that all access to a hidden symbol will know
|
||||||
|
// it is hidden.
|
||||||
|
// * Mips linkers don't support creating a page and a full got entry for
|
||||||
|
// the same symbol.
|
||||||
|
// * Given all that, we have to use a full got entry for hidden symbols :-(
|
||||||
if (GV->hasLocalLinkage())
|
if (GV->hasLocalLinkage())
|
||||||
return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
|
return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user