diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-02-08 10:05:09 +0000 |
commit | d585b66fa4d11059948f466c9080a6826932358d (patch) | |
tree | 8b06692920852c297635b46a7d616c3066f95fac /sysdeps/generic/libc-start.c | |
parent | e7cbcee4982d8caa809a91c9cfef5fda67445f0a (diff) |
Updated to fedora-glibc-20050208T0948cvs/fedora-glibc-2_3_4-6
Diffstat (limited to 'sysdeps/generic/libc-start.c')
-rw-r--r-- | sysdeps/generic/libc-start.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c index ad5ebe0911..5bb8a9b352 100644 --- a/sysdeps/generic/libc-start.c +++ b/sysdeps/generic/libc-start.c @@ -80,6 +80,10 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char ** void *__unbounded stack_end) __attribute__ ((noreturn)); + +/* Note: the fini parameter is ignored here. It used to be registered + with __cxa_atexit. This had the disadvantage that finalizers were + called in more than one place. */ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), int argc, char *__unbounded *__unbounded ubp_av, @@ -158,10 +162,6 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), __libc_init_first (argc, argv, __environ); #endif - /* Register the destructor of the program, if any. */ - if (fini) - __cxa_atexit ((void (*) (void *)) fini, NULL, NULL); - #ifndef SHARED /* Some security at this point. Prevent starting a SUID binary where the standard file descriptors are not opened. We have to do this @@ -184,6 +184,22 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), ); #ifdef SHARED + /* Auditing checkpoint: we have a new object. */ + if (__builtin_expect (GLRO(dl_naudit) > 0, 0)) + { + struct audit_ifaces *afct = GLRO(dl_audit); + struct link_map *head = GL(dl_ns)[LM_ID_BASE]._ns_loaded; + for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) + { + if (afct->preinit != NULL) + afct->preinit (&head->l_audit[cnt].cookie); + + afct = afct->next; + } + } +#endif + +#ifdef SHARED if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0)) GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]); #endif |