[lld] [ELF] Sort forawrd thunks by destination to prevent convergence failures (PR #211721)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 27 12:54:29 PDT 2026
================
@@ -4107,6 +4107,32 @@ InputSection *ThunkSection::getTargetInputSection() const {
return t->getTargetInputSection();
}
+// Move forward thunks to the right half and sort them by destination VA:
----------------
aeubanks wrote:
if we ensured that the backward thunks are always partitioned before the forward thunks then another alternative is to walk the forward thunks backwards, that would match walking the backward thunks forward. that seems like more state tracking in lld though.
ideally newly added thunks after pass 0 would also be inserted in the right place to maintain the behavior in this patch for all passes. actually, if we kept track of the partition between backward and forward thunks and did the forward/backward walking i mentioned above, it's simpler to maintain the thunk sorting invariant of backward thunks before forward thunks for newly added thunks after pass 0 rather than also wanting forward thunks to be sorted on top of the forward/backward partitioning.
https://github.com/llvm/llvm-project/pull/211721
More information about the llvm-commits
mailing list