1 #include <stdio.h> 2 3 #ifndef NAME 4 int main(void)5main (void) 6 { 7 puts ("main"); 8 } 9 #else 10 static void __attribute__ ((constructor)) init(void)11init (void) 12 { 13 puts ("init: " NAME); 14 } 15 static void __attribute__ ((destructor)) fini(void)16fini (void) 17 { 18 puts ("fini: " NAME); 19 } 20 #endif 21