summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-20 17:45:03 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2005-03-20 17:45:03 +0000
commitffd5ef60722c8a7295731cb6f7f54126fd07da3e (patch)
treeb6cf7b6e2d13c1e5f59c6edf0ce728886bfa77b1 /libc/misc
parentd028db7898abe3472c9c5f0019d1dfaa14ecbdc2 (diff)
Prepare for moving ldso FINI handling into libc.
#define _DL_DO_FINI_IN_LIBC to enable(the arch specific part needs to be in place first).
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);
}