[lld] [ELF] Keep non-alloc orphan sections at the end (PR #94519)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 13:13:54 PDT 2024


================
@@ -1316,8 +1320,8 @@ template <class ELFT> void Writer<ELFT>::sortOrphanSections() {
   i = firstSectionOrDotAssignment;
 
   while (nonScriptI != e) {
-    auto pos = findOrphanPos(i, nonScriptI);
     OutputSection *orphan = &cast<OutputDesc>(*nonScriptI)->osec;
+    auto pos = findOrphanPos(i, nonScriptI);
----------------
MaskRay wrote:

Hmm, `nonScriptI` is an iterator, not a lambda. So its current name seems fine.

https://github.com/llvm/llvm-project/pull/94519


More information about the llvm-commits mailing list