diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -1872,8 +1872,8 @@ uint64_t src) { for (std::pair tp : isd->thunkSections) { ThunkSection *ts = tp.first; - uint64_t tsBase = os->addr + ts->outSecOff + rel.addend; - uint64_t tsLimit = tsBase + ts->getSize() + rel.addend; + uint64_t tsBase = os->addr + ts->outSecOff; + uint64_t tsLimit = tsBase + ts->getSize(); if (target->inBranchRange(rel.type, src, (src > tsLimit) ? tsBase : tsLimit)) return ts;