December 2024
Beginner
226 pages
6h 11m
English
What happens before main stays in main
For programmers working with C++ on various operating systems, the entry point of an application is a concept that requires a deep understanding of the underlying architecture. In this chapter, we’ll analyze how an application starts, focusing on the initialization code that’s executed before we reach the user-defined main() function.
While exploring this process under Linux, we’ll analyze the Executable and Linkable Format (ELF), detailing how the execve() system call loads and executes a _start() function, which prepares the runtime environment before calling main(). We’ll also explore some compiler-specific extensions that we can use to manipulate ...
Read now
Unlock full access