[lld] [lld-macho] Fix branch extension thunk estimation logic (PR #120529)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 10:15:48 PST 2024
================
@@ -184,15 +184,42 @@ uint64_t TextOutputSection::estimateStubsInRangeVA(size_t callIdx) const {
InputSection *isec = inputs[i];
isecEnd = alignToPowerOf2(isecEnd, isec->align) + isec->getSize();
}
+
+ // Tally up any thunks that have already been placed that have address higher
+ // than the equivalent callIdx. We first find the index of the first thunk
+ // that is beyond the current inputs[callIdx].
+ auto itPostcallIdxThunks = std::partition_point(
----------------
ellishg wrote:
I think we can use llvm::partition_point()
https://github.com/llvm/llvm-project/pull/120529
More information about the llvm-commits
mailing list