Unwind Info

Tells the runtime how to unwind the stack for exception handling and debugging purposes. There are two formats in which the unwind info can be encoded: the DWARF format and the newer “compact unwind” format.

The compact unwind format, as its name suggests, is more compact. However, it is limited in what it can encode; the DWARF format is more general. As such, the DWARF format continues to be used as a fallback.

The compact unwind takes different forms in object files vs binaries. In object files, it can be found under the __compact_unwind section; the linker is responsible for transforming the data there into the output form, which will be written to the __unwind_info section.

The DWARF info is stored in the __eh_frame section (in both object files and binaries). The __unwind_info section in output binaries will contain pointers into the __eh_frame section.

Unwind info can be inspected via llvm-objdump --macho --unwind-info --dwarf=frames.

TODO: talk about personality functions and LSDAs