Function before and after main()
Did you start to execute functions before and after the main() function ?
you have two solutions to do that :
first solution is editing in the linker script
the second one is adding these prototypes in your source code
void start( void ) __attribute__ ((constructor)) ;
void end( void ) __attribute__ ((destructor));
and define you functions by adding any instructions you want to execute like that for example
void start()
{
printf("Start\n");
}
void end()
{
printf("end\n");
}
int main()
{
printf("Hello");
}
Finally when you compile this program you get excited