View | Details | Raw Unified
Collapse All | Expand All

(-) uClibc-0.9.28/libc/stdlib/atexit.c (-3 / +23 lines)
 Lines 160-165    Link Here 
void attribute_hidden (*__rtld_fini)(void) = NULL;
void attribute_hidden (*__rtld_fini)(void) = NULL;
#ifdef _DL_FINI_CRT_COMPAT
void attribute_hidden (*__dl_fini)(void) = NULL;
void _set__dl_fini(void *fini_func)
{
	if (fini_func != NULL)
		__dl_fini = fini_func;
}
#endif
/* __uClibc_start_main is the new main stub for uClibc. This function is
/* __uClibc_start_main is the new main stub for uClibc. This function is
 * called from crt0 (version 0.9.16 or newer), after ALL shared libraries
 * called from crt0 (version 0.9.16 or newer), after ALL shared libraries
 * are initialized, just before we call the application's main function.
 * are initialized, just before we call the application's main function.
 Lines 766-776    Link Here 
#ifdef _DL_FINI_CRT_COMPAT
#ifdef _DL_FINI_CRT_COMPAT
	/* arches that have moved their ldso FINI handling should skip this part */
	/* arches that have moved their ldso FINI handling should skip this part */
	{
	{
		int (*_dl_atexit) (void *) = (int (*)(void *)) (intptr_t) _dl_find_hash("atexit",
		void (*__set__dl_fini) (void *) = (void (*)(void *)) (intptr_t) _dl_find_hash("_set__dl_fini",
				_dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);
				_dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);
		if (_dl_atexit)
		if (__set__dl_fini)
			(*_dl_atexit) (_dl_fini);
			(__set__dl_fini)(_dl_fini);
		else
			_dl_if_debug_dprint("_set__dl_fini not found\n");
	}
	}
#endif
#endif
 Lines 223-228    Link Here 
#endif
#endif
extern void (*__rtld_fini)(void);
extern void (*__rtld_fini)(void);
#ifdef _DL_FINI_CRT_COMPAT
extern void (*__dl_fini)(void);
#endif
/*
/*
 * Normal program termination
 * Normal program termination
 */
 */
 Lines 242-247    Link Here 
#ifndef _DL_FINI_CRT_COMPAT
#ifndef _DL_FINI_CRT_COMPAT
	if (__rtld_fini != NULL)
	if (__rtld_fini != NULL)
		(__rtld_fini)();
		(__rtld_fini)();
#else
	if (__dl_fini != NULL)
		(__dl_fini)();
#endif
#endif
    /* If we are using stdio, try to shut it down.  At the very least,
    /* If we are using stdio, try to shut it down.  At the very least,