summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/__uClibc_main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 33fc2ec68..a33e6fe4a 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -155,16 +155,18 @@ void __uClibc_init(void)
}
#ifdef __UCLIBC_CTOR_DTOR__
-void (*__app_fini)(void) = NULL;
+void attribute_hidden (*__app_fini)(void) = NULL;
#endif
+void attribute_hidden (*__rtld_fini)(void) = NULL;
+
/* __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
* are initialized, just before we call the application's main function.
*/
void __attribute__ ((__noreturn__))
__uClibc_start_main(int argc, char **argv, char **envp,
- void (*app_init)(void), void (*app_fini)(void))
+ void (*app_init)(void), void (*app_fini)(void), void (*rtld_fini)(void))
{
#ifdef __ARCH_HAS_MMU__
unsigned long *aux_dat;
@@ -176,6 +178,8 @@ __uClibc_start_main(int argc, char **argv, char **envp,
* __uClibc_init() regardless, to be sure the right thing happens. */
__uClibc_init();
+ __rtld_fini = rtld_fini;
+
/* If we are dynamically linked, then ldso already did this for us. */
if (__environ==NULL) {
/* Statically linked. */
@@ -260,6 +264,6 @@ __uClibc_start_main(int argc, char **argv, char **envp,
void __attribute__ ((__noreturn__))
__uClibc_main(int argc, char **argv, char ** envp)
{
- __uClibc_start_main(argc, argv, envp, NULL, NULL);
+ __uClibc_start_main(argc, argv, envp, NULL, NULL, NULL);
}