summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Arch/PPC64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Arch/PPC64.cpp')
-rw-r--r--lld/ELF/Arch/PPC64.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp
index 995c3f899d8..b654787393d 100644
--- a/lld/ELF/Arch/PPC64.cpp
+++ b/lld/ELF/Arch/PPC64.cpp
@@ -774,7 +774,10 @@ bool PPC64::needsThunk(RelExpr Expr, RelType Type, const InputFile *File,
// If the offset exceeds the range of the branch type then it will need
// 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));
}
bool PPC64::inBranchRange(RelType Type, uint64_t Src, uint64_t Dst) const {
OpenPOWER on IntegriCloud