9 /* atexit.c and __stdio_exit.c override these. the latter is linked
10 * as a consequence of linking either __toread.c or __towrite.c. */
11 weak_alias(dummy
, __funcs_on_exit
);
12 weak_alias(dummy
, __stdio_exit
);
14 extern void _fini() __attribute__((weak
));
15 extern void (*const __fini_array_start
)() __attribute__((weak
));
16 extern void (*const __fini_array_end
)() __attribute__((weak
));
18 static void libc_exit_fini(void)
20 uintptr_t a
= (uintptr_t)&__fini_array_end
;
21 for (; a
>(uintptr_t)&__fini_array_start
; a
-=sizeof(void(*)()))
22 (*(void (**)())(a
-sizeof(void(*)())))();
26 weak_alias(libc_exit_fini
, __libc_exit_fini
);
28 _Noreturn
void exit(int code
)