diff options
Diffstat (limited to 'ELF/Arch/PPC64.cpp')
-rw-r--r-- | ELF/Arch/PPC64.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ELF/Arch/PPC64.cpp b/ELF/Arch/PPC64.cpp index cbfa8073d33fe..f02e818daee53 100644 --- a/ELF/Arch/PPC64.cpp +++ b/ELF/Arch/PPC64.cpp @@ -757,7 +757,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)); } uint32_t PPC64::getThunkSectionSpacing() const { |