[all-commits] [llvm/llvm-project] 8c6402: [lld][MachO] Add N_COLD_FUNC support (#183909)

Zhaoxuan Jiang via All-commits all-commits at lists.llvm.org
Thu Jun 11 14:00:50 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c64020b2397fc5dddd577276020cbb30cdbc6cc
      https://github.com/llvm/llvm-project/commit/8c64020b2397fc5dddd577276020cbb30cdbc6cc
  Author: Zhaoxuan Jiang <jiangzhaoxuan94 at gmail.com>
  Date:   2026-06-11 (Thu, 11 Jun 2026)

  Changed paths:
    M lld/MachO/BPSectionOrderer.cpp
    M lld/MachO/Driver.cpp
    M lld/MachO/ICF.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/SectionPriorities.cpp
    M lld/MachO/SymbolTable.cpp
    M lld/MachO/SymbolTable.h
    M lld/MachO/Symbols.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/Writer.cpp
    A lld/test/MachO/bp-section-orderer-cold.s
    A lld/test/MachO/cold-func-weak-merge.s
    A lld/test/MachO/cold-func.s

  Log Message:
  -----------
  [lld][MachO] Add N_COLD_FUNC support (#183909)

Parse `N_COLD_FUNC` from input object files and use it to move cold
functions to the end of __text, after all non-cold and ordered symbols.

Key behaviors:
- Cold functions are placed after all non-cold unordered symbols.
- Order file entries take precedence over the cold attribute: a cold
function listed in the order file retains its specified position.
- BP interaction: utilize the subgrouping introduced in #185661 to split
`N_COLD_FUNC` sections into a distinct subgroup.
- ICF interaction: when a non-cold section is folded into a cold master,
the master's coldness is unset. With safe_thunks, cold
address-significant functions get cold thunks placed in the cold region.
- The `N_COLD_FUNC` flag is stripped from the output symbol table.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list