[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 12:10:48 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:

Thx. I'll make a separate NFC commit to rename this and reorder the two statements.

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


More information about the llvm-commits mailing list