Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 98187 | Differences between
and this patch

Collapse All | Expand All

(-)uClibc-0.9.28/libc/misc/internals/__uClibc_main.c (+10 lines)
Lines 160-165 Link Here
160
160
161
void attribute_hidden (*__rtld_fini)(void) = NULL;
161
void attribute_hidden (*__rtld_fini)(void) = NULL;
162
162
163
#ifdef _DL_FINI_CRT_COMPAT
164
void attribute_hidden (*__dl_fini)(void) = NULL;
165
166
void _set__dl_fini(void *fini_func)
167
{
168
	if (fini_func != NULL)
169
		__dl_fini = fini_func;
170
}
171
#endif
172
163
/* __uClibc_start_main is the new main stub for uClibc. This function is
173
/* __uClibc_start_main is the new main stub for uClibc. This function is
164
 * called from crt0 (version 0.9.16 or newer), after ALL shared libraries
174
 * called from crt0 (version 0.9.16 or newer), after ALL shared libraries
165
 * are initialized, just before we call the application's main function.
175
 * are initialized, just before we call the application's main function.
(-)uClibc-0.9.28/ldso/ldso/ldso.c (-3 / +5 lines)
Lines 766-776 Link Here
766
#ifdef _DL_FINI_CRT_COMPAT
766
#ifdef _DL_FINI_CRT_COMPAT
767
	/* arches that have moved their ldso FINI handling should skip this part */
767
	/* arches that have moved their ldso FINI handling should skip this part */
768
	{
768
	{
769
		int (*_dl_atexit) (void *) = (int (*)(void *)) (intptr_t) _dl_find_hash("atexit",
769
		void (*__set__dl_fini) (void *) = (void (*)(void *)) (intptr_t) _dl_find_hash("_set__dl_fini",
770
				_dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);
770
				_dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT);
771
771
772
		if (_dl_atexit)
772
		if (__set__dl_fini)
773
			(*_dl_atexit) (_dl_fini);
773
			(__set__dl_fini)(_dl_fini);
774
		else
775
			_dl_if_debug_dprint("_set__dl_fini not found\n");
774
	}
776
	}
775
#endif
777
#endif
776
778
(-)uClibc-0.9.28/libc/stdlib/atexit.c (+8 lines)
Lines 223-228 Link Here
223
#endif
222
#endif
224
223
225
extern void (*__rtld_fini)(void);
224
extern void (*__rtld_fini)(void);
225
226
#ifdef _DL_FINI_CRT_COMPAT
227
extern void (*__dl_fini)(void);
228
#endif
229
226
/*
230
/*
227
 * Normal program termination
231
 * Normal program termination
228
 */
232
 */
Lines 242-247 Link Here
242
#ifndef _DL_FINI_CRT_COMPAT
246
#ifndef _DL_FINI_CRT_COMPAT
243
	if (__rtld_fini != NULL)
247
	if (__rtld_fini != NULL)
244
		(__rtld_fini)();
248
		(__rtld_fini)();
249
#else
250
	if (__dl_fini != NULL)
251
		(__dl_fini)();
245
#endif
252
#endif
246
253
247
    /* If we are using stdio, try to shut it down.  At the very least,
254
    /* If we are using stdio, try to shut it down.  At the very least,

Return to bug 98187