summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-09-08 02:29:37 +0000
committerMike Frysinger <vapier@gentoo.org>2005-09-08 02:29:37 +0000
commit073cd03a2c5b0eb6c0872622f840f4a9724a9b04 (patch)
tree4a88ed2b1501a63d036a9d928e08e9841c8b414f /ldso
parentee11fb2608a02a6563bc38dc1bc38510fcc0ab9e (diff)
Fix by Martin Schlemmer:
If _DL_FINI_CRT_COMPAT is defined, _dl_fini is setup to run at exit via atexit(), but this makes it run _before_ the fini (__app_fini()) of the app, causing stuff like sandbox that frees structs, etc via its fini to segfault. http://bugs.gentoo.org/98187
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/ldso.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index db250f0be..f6ac50905 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -766,11 +766,13 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
#ifdef _DL_FINI_CRT_COMPAT
/* 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);
- if (_dl_atexit)
- (*_dl_atexit) (_dl_fini);
+ if (__set__dl_fini)
+ (*__set__dl_fini)(_dl_fini);
+ else
+ _dl_if_debug_dprint("_set__dl_fini not found\n");
}
#endif