diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 14:13:04 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-12-23 14:13:04 +0000 |
commit | 194067b913cf53460c3149a06292164c8fcc42ee (patch) | |
tree | d24cd5551512439622e8e2bde28891fd42fe0d48 /libexec | |
parent | b10eb93216c8e451ec759acbd083580f4c286437 (diff) |
Call __cxa_atexit(3) instead of atexit(3). Preparation for upcoming changes to
make it possible to call atexit from dynamically loaded shared objects.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/ld.so/loader.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c index b7a2d109347..e634e96e3cc 100644 --- a/libexec/ld.so/loader.c +++ b/libexec/ld.so/loader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: loader.c,v 1.135 2013/12/23 13:57:44 kettenis Exp $ */ +/* $OpenBSD: loader.c,v 1.136 2013/12/23 14:13:03 kettenis Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -616,14 +616,14 @@ _dl_boot(const char **argv, char **envp, const long dyn_loff, long *dl_data) Elf_Addr ooff; sym = NULL; - ooff = _dl_find_symbol("atexit", &sym, + ooff = _dl_find_symbol("__cxa_atexit", &sym, SYM_SEARCH_ALL|SYM_NOWARNNOTFOUND|SYM_PLT, NULL, dyn_obj, &sobj); if (sym == NULL) - _dl_printf("cannot find atexit, destructors will not be run!\n"); + _dl_printf("cannot find __cxa_atexit, destructors will not be run!\n"); else - (*(void (*)(Elf_Addr))(sym->st_value + ooff)) - ((Elf_Addr)_dl_dtors); + (*(void (*)(void (*)(void), void *, void *)) + (sym->st_value + ooff))(_dl_dtors, NULL, NULL); } #endif |