diff options
Diffstat (limited to 'csu/elf-init.c')
-rw-r--r-- | csu/elf-init.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/csu/elf-init.c b/csu/elf-init.c index fcf6a04315..12ae15747c 100644 --- a/csu/elf-init.c +++ b/csu/elf-init.c @@ -38,10 +38,14 @@ #ifdef HAVE_INITFINI_ARRAY /* These magic symbols are provided by the linker. */ -extern void (*__preinit_array_start []) (void) attribute_hidden; -extern void (*__preinit_array_end []) (void) attribute_hidden; -extern void (*__init_array_start []) (void) attribute_hidden; -extern void (*__init_array_end []) (void) attribute_hidden; +extern void (*__preinit_array_start []) (int, char **, char **) + attribute_hidden; +extern void (*__preinit_array_end []) (int, char **, char **) + attribute_hidden; +extern void (*__init_array_start []) (int, char **, char **) + attribute_hidden; +extern void (*__init_array_end []) (int, char **, char **) + attribute_hidden; extern void (*__fini_array_start []) (void) attribute_hidden; extern void (*__fini_array_end []) (void) attribute_hidden; @@ -75,7 +79,7 @@ extern void _fini (void); the libc.a module in that it doesn't call the preinit array. */ void -__libc_csu_init (void) +__libc_csu_init (int argc, char **argv, char **envp) { #ifdef HAVE_INITFINI_ARRAY /* For dynamically linked executables the preinit array is executed by @@ -87,7 +91,7 @@ __libc_csu_init (void) const size_t size = __preinit_array_end - __preinit_array_start; size_t i; for (i = 0; i < size; i++) - (*__preinit_array_start [i]) (); + (*__preinit_array_start [i]) (argc, argv, envp); } # endif #endif @@ -99,7 +103,7 @@ __libc_csu_init (void) const size_t size = __init_array_end - __init_array_start; size_t i; for (i = 0; i < size; i++) - (*__init_array_start [i]) (); + (*__init_array_start [i]) (argc, argv, envp); } #endif } @@ -111,11 +115,11 @@ void __libc_csu_fini (void) { #ifndef LIBC_NONSHARED -#ifdef HAVE_INITFINI_ARRAY +# ifdef HAVE_INITFINI_ARRAY size_t i = __fini_array_end - __fini_array_start; while (i-- > 0) (*__fini_array_start [i]) (); -#endif +# endif _fini (); #endif |