ZDX ACADEMY

Understanding Apple Mach-O Binary Internals · Symbols, relocations and dynamic linking

Language:English

Symbols, string tables and dynamic linking

Mach-O separates several related ideas that beginners often collapse into “the symbol table.”

LC_SYMTAB points to two regions:

Each symbol record stores an index into the string table rather than embedding a full name.

Static relocations and runtime fixups are different things

Object files and some linked images can carry relocation records associated with sections. In a section record, fields such as reloff and nreloc locate those relocation entries.

There is not a generic Mach-O load command named LC_RELOC.

Modern dynamic loading uses additional dyld metadata. Depending on the image and toolchain generation, you may encounter:

Do not assume one historical representation. Follow the load commands actually present in the file.

A symbol is not necessarily a function

A name in a symbol table can represent different kinds of entities. Likewise, executable code can exist without a helpful exported symbol name.

Use symbols as evidence, not as ground truth for function boundaries.

Imports are relationships

When you see an imported API, ask:

Stripping changes convenience, not executable meaning

Removing many symbols can make human analysis harder, but the loader still needs enough structural information to load and fix up the image. This is why dyld metadata often remains useful when a binary has few conventional symbols.

Course outline