stdlib: Move _IO_cleanup to call_function_static_weak

Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Adhemerval Zanella 2022-11-13 15:49:27 -03:00
parent d4facb63ff
commit 5dcd2d0ad0
3 changed files with 2 additions and 9 deletions

View File

@ -568,9 +568,6 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
PROVIDE(__start___libc_subfreeres = .);\
__libc_subfreeres : { *(__libc_subfreeres) }\
PROVIDE(__stop___libc_subfreeres = .);\
PROVIDE(__start___libc_atexit = .);\
__libc_atexit : { *(__libc_atexit) }\
PROVIDE(__stop___libc_atexit = .);\
PROVIDE(__start___libc_IO_vtables = .);\
__libc_IO_vtables : { *(__libc_IO_vtables) }\
PROVIDE(__stop___libc_IO_vtables = .);\

View File

@ -1115,5 +1115,3 @@ _IO_list_resetlock (void)
#endif
}
libc_hidden_def (_IO_list_resetlock)
text_set_element(__libc_atexit, _IO_cleanup);

View File

@ -20,11 +20,9 @@
#include <unistd.h>
#include <pointer_guard.h>
#include <libc-lock.h>
#include <libio/libioP.h>
#include "exit.h"
#include "set-hooks.h"
DEFINE_HOOK (__libc_atexit, (void))
/* Initialize the flag that indicates exit function processing
is complete. See concurrency notes in stdlib/exit.h where
__exit_funcs_lock is declared. */
@ -128,7 +126,7 @@ __run_exit_handlers (int status, struct exit_function_list **listp,
__libc_lock_unlock (__exit_funcs_lock);
if (run_list_atexit)
RUN_HOOK (__libc_atexit, ());
call_function_static_weak (_IO_cleanup);
_exit (status);
}