Who calls your main()?

I was curious as how to a C program in executed by the OS and came across this interesting article:

Create your C library
The file “crt0” is created during the linking stage, which sets up the working environment and finally calls the main() within the program. The  _start function is able to set up the standard library, call the global constructors, and call exit(main(argc, argv)).

Advertisements