Changeset View
Changeset View
Standalone View
Standalone View
contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
Show First 20 Lines • Show All 751 Lines • ▼ Show 20 Lines | bool PPC64::needsThunk(RelExpr Expr, RelType Type, const InputFile *File, | ||||
// If a symbol is a weak undefined and we are compiling an executable | // If a symbol is a weak undefined and we are compiling an executable | ||||
// it doesn't need a range-extending thunk since it can't be called. | // it doesn't need a range-extending thunk since it can't be called. | ||||
if (S.isUndefWeak() && !Config->Shared) | if (S.isUndefWeak() && !Config->Shared) | ||||
return false; | return false; | ||||
// If the offset exceeds the range of the branch type then it will need | // If the offset exceeds the range of the branch type then it will need | ||||
// a range-extending thunk. | // a range-extending thunk. | ||||
return !inBranchRange(Type, BranchAddr, S.getVA()); | // See the comment in getRelocTargetVA() about R_PPC64_CALL. | ||||
return !inBranchRange(Type, BranchAddr, | |||||
S.getVA() + | |||||
getPPC64GlobalEntryToLocalEntryOffset(S.StOther)); | |||||
} | } | ||||
uint32_t PPC64::getThunkSectionSpacing() const { | uint32_t PPC64::getThunkSectionSpacing() const { | ||||
// See comment in Arch/ARM.cpp for a more detailed explanation of | // See comment in Arch/ARM.cpp for a more detailed explanation of | ||||
// getThunkSectionSpacing(). For PPC64 we pick the constant here based on | // getThunkSectionSpacing(). For PPC64 we pick the constant here based on | ||||
// R_PPC64_REL24, which is used by unconditional branch instructions. | // R_PPC64_REL24, which is used by unconditional branch instructions. | ||||
// 0x2000000 = (1 << 24-1) * 4 | // 0x2000000 = (1 << 24-1) * 4 | ||||
return 0x2000000; | return 0x2000000; | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |