IT lexicon › Programming › Compact unwind

Compact unwind

Programming På svenska → Updated: 2026-11-07

Apple's compact unwind format, which describes the entire stack frame of most functions in 32 bits rather than a DWARF instruction stream.

Stack unwinding needs to know, at every instruction, where the return address and saved registers live. DWARF's .eh_frame can describe anything, but it is effectively a little program to be interpreted, and sized accordingly. Apple's insight was that almost every function looks the same: either a standard frame pointer or a fixed stack size, plus a list of which callee-saved registers got stashed.

So the compiler emits one 32-bit word per function, and the ld64 linker packs them into a __unwind_info section with a two-level lookup table. Functions that don't fit the mould, typically hand-written assembly or odd prologues, carry a flag that says "go look in DWARF instead". The result is a fraction of the size and faster lookups, on both x86-64 and arm64.

← Back to the lexicon