The call to main() is a substance of C, and the call to _start() is the kernel item indicated by the entry point in the binary header. (for clarity: the kernel does not want or should not know what we call it _start )
If you have non-C binary, you may not have a main() function, you cannot even have the concept of a function at all.
So the real question is: why does the compiler not give the address of main() as a starting point? This is because typical libc implementations want to do some initialization before starting the program, see Other answers for this.
edit , you can change the entry point as follows:
$ cat entrypoint.c int blabla() { printf("Yes it works!\n"); exit(0); } int main() { printf("not called\n"); } $ gcc entrypoint.c -e blabla $ ./a.out Yes it works!
source share