Yes, you can.
_start
function is the entry point of a C program which makes a call to main()
.
Going further into it, main()
is the starting point of a C program from the programmer's perspective. Before calling main()
, a process executes a bulk of code to "clean up the room for execution".
_start
is the function which gets called first, which then allocates necessary resources and then calls main()
which has to be defined by the programmer.
You can override _start
and tell the compiler to not to look for main()
by using "-nostartfiles
" option.
#include <stdio.h> //for using printf()
_start()
{
printf("Hello world!!\n");
_exit(0);
}
To Compile : gcc -nostartfiles code.c -o a.out
Also look at http://linuxgazette.net/issue84/hawk.html for more basic information.