How to start a program
summary
Shows exactly what Linux/ELF does when an executable starts: the kernel maps segments, sets the instruction pointer to entry point 0x1040 which lands in _start, that calls libc_start_main which iterates the ._init_array and runs C++ constructors, BSS pages are zeroed by the kernel, relocations and the GOT get fixed by the loader ld‑linux.so for shared objects, execve replaces a process while fork+exec spawns children, destructors are registered via __cxa_atexit and run in reverse order, tools used include objdump, readelf and gdb and a three‑instruction asm program returns 42 via syscall.
AI-written summary · about
chapters (10)
- 0:00Introduction and scope
- 2:17Program execution internals
- 5:18Analyzing binary structure
- 13:04The entry point and libc
- 16:37Minimal program startup
- 20:39Fork and execve mechanics
- 30:44Linking and segments
- 38:19Static and dynamic initialization
- 49:25Program exit handlers
- 53:20Shared objects and dynamic loading
related talks
01h 04mThe Bits Between the Bits: How We Get to main()
01h 00mFrom Program to Process - What Happens After the Compiler
01h 02mHow Linux Elf Symbols Work and How They Are Used in C++ and C Programming
59mHello World From Scratch
01h 26mWhat Does the Linker Actually Do for Us?
01h 26mLinux User/Kernel ABI: the realities of how C and C++ programs really talk to the OS
37mLet there be light: from nothing to a running application
47mThe boot process: a modern history of computing
