Skip to content

Glossary

Chained fixups

The modern Mach-O relocation format. Pointers in the binary encode the next fixup's offset in-line; dyld walks the chain in O(fixups), not O(opcode stream).

Chained fixups are the modern relocation format for Mach-O binaries, introduced in 2020. They replace the classic separate rebase + bind opcode streams with a single mechanism encoded into the binary's pointers themselves.

How they work:

  • A 64-bit slot at a fixup site holds either the target value (rebased or bound), or — if not the last in a chain — a small offset to the next fixup in the chain.
  • The binary stores chain starts — a handful of starting offsets per page.
  • dyld walks each chain, applies each fixup in O(fixups), not O(opcode bytes).
apple-oss-distributions/dylddyld/Loader.cppChained-fixup application — search for ChainedFixups in the loader.View on GitHub(line )

The win versus the old opcode-stream format:

  • 5-10× faster fixup application for typical binaries.
  • Smaller LINKEDIT segment because the fixup metadata is in-line.
  • The shared cache builder can pre-link every cached dylib once; each process just needs to verify the cache base address is what's expected.

Required minimum macOS version to use chained fixups: 12 (Monterey). Below that, the older format is emitted.

See also: dyld, Mach-O, and the dyld in depth article.