summaryrefslogtreecommitdiff
path: root/ELF/Arch/PPC64.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-07-06 15:34:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-07-06 15:34:09 +0000
commitd94942eacdeb6ebb3750a700e6410e7691dd70e5 (patch)
treead193d65c3e5f0da5008886a54cf0e4010f94b0a /ELF/Arch/PPC64.cpp
parent444e4712399dfed9a74a0a1bd4880ea138a86616 (diff)
Notes
Diffstat (limited to 'ELF/Arch/PPC64.cpp')
-rw-r--r--ELF/Arch/PPC64.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ELF/Arch/PPC64.cpp b/ELF/Arch/PPC64.cpp
index cbfa8073d33f..f02e818daee5 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 {