[PATCH] D117734: [ELF] Fix the branch range computation when reusing a thunk
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 21 06:45:59 PST 2022
peter.smith added a comment.
> I'd like to use t->getThunkTargetSym()->getVA(getPCBias(rel.type)) but two arm-* tests would fail. I think that is the remaining getPCBias issue after D97550 <https://reviews.llvm.org/D97550>. Not fixing it is probably fine since the failing scenario seems extremely corner-case.
I think this is very nearly right. On Arm the relocation addend is negative to offset the PC BIAS, so we'll need to invert it. For example:
`target->inBranchRange(rel.type, src, t->getThunkTargetSym()->getVA(-getPCBias(rel.type))))`
Will see if I can come up with a test case that fails without that and will post it here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117734/new/
https://reviews.llvm.org/D117734
More information about the llvm-commits
mailing list