Annotation of dietlibc/dyn_stop.c, revision 1.1
1.1 ! olaf 1: typedef void(*structor)(void);
! 2:
! 3: #if 0
! 4: /* dirty trick to force gcc to be in the data section (see dyn_start) */
! 5: static structor force_to_data[0] = {};
! 6:
! 7: /* terminate the Construc/DestrucTORS with a NULL element */
! 8: asm ( ".section .ctors,\"aw\" ");
! 9: static structor __CTOR_END__[1]={((structor)0)};
! 10:
! 11: asm ( ".section .dtors,\"aw\" ");
! 12: static structor __DTOR_END__[1]={((structor)0)};
! 13: #else
! 14: __attribute__((section(".ctors")))
! 15: static structor __CTOR_END__[1]={((structor)0)};
! 16:
! 17: __attribute__((section(".dtors")))
! 18: static structor __DTOR_END__[1]={((structor)0)};
! 19: #endif
! 20:
! 21: static void __do_global_ctors_aux(void)
! 22: {
! 23: structor *cf=__DTOR_END__; /* ugly trick to prevent warning */;
! 24: for(cf=((__CTOR_END__)-1); (*cf) != (structor)-1; cf--) (*cf)();
! 25: }
! 26:
! 27: __attribute__((section(".init"))) void _init()
! 28: {
! 29: __do_global_ctors_aux();
! 30: }
! 31:
LinuxTV legacy CVS <linuxtv.org/cvs>