Linking, the ABI and quality

How a program becomes an executable and how it stays correct: advanced macros and includes, object files joined by the linker, the difference between 32-bit and 64-bit code, the System V ABI in full, a Makefile that rebuilds only what changed, optimization that starts from a measurement, and the error codes a syscall returns.

6.1 Advanced macros and %include %include, %define and %assign, and the conditional assembly of %if Open 6.2 Linking object files one program in two objects, the symbols they share, and a static link with ld Open 6.3 32-bit vs 64-bit the register set, the syscall instruction and the calling convention of each mode Open 6.4 The System V ABI the six integer argument registers, the callee-saved set, and the red zone a signal may not touch Open 6.5 Makefiles for assembly a minimal Makefile, a pattern rule for .asm to .o, and the dependencies that rebuild an object Open 6.6 Optimization basics measure before changing anything, the memory access that costs most, and the patterns that remove it Open 6.7 Error codes and logging the negative return of a failed syscall, the errno values, and a log line written to a file Open

Lessons