[lld] [lld][MachO] Add N_COLD_FUNC support (PR #183909)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 09:51:25 PST 2026


================
@@ -1007,13 +1007,23 @@ static void sortSegmentsAndSections() {
         osec->align = tlvAlign;
       }
 
-      if (!isecPriorities.empty()) {
-        if (auto *merged = dyn_cast<ConcatOutputSection>(osec)) {
-          llvm::stable_sort(
-              merged->inputs, [&](InputSection *a, InputSection *b) {
-                return isecPriorities.lookup(a) < isecPriorities.lookup(b);
-              });
-        }
+      if (auto *merged = dyn_cast<ConcatOutputSection>(osec)) {
----------------
alx32 wrote:

Would we be able to easily check whether N_COLD was not seen at all and skip sorting if that was the case ? 

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


More information about the llvm-commits mailing list