[lld] [LLD] Implement --enable-non-contiguous-regions (PR #90007)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 13:57:49 PDT 2024


================
@@ -1464,6 +1466,12 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
                     " does not converge");
         break;
       }
+    } else if (spilled) {
+      // Spilling can change relative section order, so recompute anything that
+      // depends on it.
+      for (Partition &part : partitions)
----------------
MaskRay wrote:

Create a lambda to avoid duplicating the few lines. We might add more in the future and could accidentally break --enable-non-contiguous-regions

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


More information about the llvm-commits mailing list