[lld] [lld] Sort code section chunks by range types on Arm64EC targets. (PR #69099)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 05:24:17 PDT 2023


================
@@ -1377,6 +1379,21 @@ void Writer::mergeSections() {
   }
 }
 
+// EC targets may have chunks of various architectures mixed together at this
+// point. Group code chunks of the same architecture together by sorting chunks
+// by their EC range type.
+void Writer::sortECChunks() {
+  if (!isArm64EC(ctx.config.machine))
+    return;
+
+  for (OutputSection *sec : ctx.outputSections) {
+    if (sec->isCodeSection())
----------------
mstorsjo wrote:

Oh, right, here's a new call to the recently refactored function, sorry I didn't see it before. That makes the coupling much clearer.

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


More information about the llvm-commits mailing list