Your shell, kernel, dynamic linker and C runtime run before you ever reach main. In this article we talk about the entire process(almost the entire process) including a little primer about the ELF file format.