calling function in .init and .fini gives problem
mohanlal jangir
mohanlaljangir@hotmail.com
Thu May 20 14:37:00 GMT 2004
I tried to run following program, but is giving "Illegal instruction" error
after function premain is called. Can somebody correct me, what I am doing
wrong?
#include <stdio.h>
int __attribute__((__section__(".init"))) premain(void) {
printf("it should appear before main!!!\n");
return 0;
}
int main(void) {
printf("******************\n");
printf("in main\n");
printf("main is returning\n");
printf("******************\n");
return 0;
}
static int __attribute__((__section__(".fini"))) postmain(void) {
printf("it should appear after main!!!\n");
return 0;
}
Regards
Mohanlal
P.S. Please cc me in reply, I am not subscribed to list.
More information about the Gcc
mailing list