Linking, Loading, and Stripped Binaries: PLT, GOT, Imports, Fixups, and Function Identification
A linked program calls functions it does not contain. This lesson reads the tables the link editor wrote for those calls in three formats, follows one call to the slot the loader fills, and finds the functions of a build after its names are gone.
160 minutesBuildPython, C, x86-64 and arm64 assemblyMembers
Learning Objectives
- Decide from a relocation record and the symbol tables what the link editor makes of it: a fixed distance, a PLT entry with a GOT slot, or a dynamic relocation.
- Read the dynamic section, the PLT, and the GOT of a position-independent ELF executable and follow one call through them with the psABI formulas.
- Read a COFF object (20-byte file header, 40-byte section entries, 18-byte symbols, 10-byte relocations) and the import, export, and base relocation directories of a PE32+ image.
- Decode a Mach-O chained fixup chain word by word and match every word against
dyld_info. - State what
stripremoves and what survives in each format, and run the stripped program to prove that it still works. - Recover the function starts of a stripped arm64 build with
LC_FUNCTION_STARTSprologue scans, and call targets, score each method against the symbol table of the unstripped twin, and name the functions with a FLIRT-shaped signature.