According to the C / C ++ standard, it main()is the starting point for a program. If you use GCC, the function _startis the entry point of the C program that makes the call main(). The main objective of the function _start()is to perform several initialization tasks.
#include <stdio.h>
#include <stdlib.h>
void program_entry(void);
void
_start(void)
{
program_entry();
}
void
program_entry(void)
{
printf("custom program entry\n");
exit(0);
}
If you want, the program record can also be compiled using the switch -ein GCC.
#include <stdio.h>
void program_entry(void);
void
_start(void)
{
program_entry();
}
void
program_entry(void)
{
printf("custom program entry\n");
}
source
share