dsymutil's Lockstep Algortihm

I was recently answering questions about dsymutil’s multi-threading model and lockstep algorithm. I decided to write it down here for future reference. This article focuses on types and the .debug_info section. Background As a reminder, dsymutil is an optimizing DWARF linker. It only retains debug info for elements that appear in the final executable. It uses the One Definition Rule (ODR) to unique C++ types. As will become clear, both of these heavily shaped its design....

June 3, 2025

Statistics in dsymutil

To make incremental builds fast on macOS, the static linker (ld) ignores the debug information. It can easily be a magnitude bigger than the rest of the program and slow down link time. Instead the linker emits a debug map which contains the location of all the object files it relocated so that debug info consumers (such as the debugger) know where to find the DWARF debug info. This approach works great during development and greatly speeds up the build-debug cycle....

May 17, 2020