If you want call other function, before main, gcc provides __attribute__
for example:
int test(void) __attribute__ ((constructor));
int test()
{
printf("\nTEST\n");
return 0;
}
int main(int argc, char** argv)
{
printf("\nHello World\n");
return 0;
}