summary refs log tree commit diff
path: root/csu
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-07-07 23:00:02 +0000
committerUlrich Drepper <drepper@redhat.com>2005-07-07 23:00:02 +0000
commit04395c90fce0f209fd71e19898e64c6614c908a1 (patch)
tree9fdfa5ce11644f91a639d19a802fec0f2dc742ba /csu
parent6f8116b3ab733b05fe07d0f930a9e28e594dbaf8 (diff)
downloadglibc-04395c90fce0f209fd71e19898e64c6614c908a1.tar.gz
glibc-04395c90fce0f209fd71e19898e64c6614c908a1.tar.xz
glibc-04395c90fce0f209fd71e19898e64c6614c908a1.zip
[BZ #974]
2005-04-13  H.J. Lu  <hongjiu.lu@intel.com>
	[BZ #974]
	* csu/elf-init.c (__preinit_array_start): Take int, char **, char **.
	(__preinit_array_end): Likewise.
	(__init_array_start): Likewise.
	(__init_array_end): Likewise.
	(__libc_csu_init): Take int argc, char **argv, char **envp.
	Call preinit_array and init_array with argc, argv, envp.
	* sysdeps/generic/libc-start.c (LIBC_START_MAIN): Remove
	INIT_MAIN_ARGS.
	* sysdeps/powerpc/elf/libc-start.c (INIT_MAIN_ARGS): Removed.
	* elf/Makefile (distribute): Add tst-array5.c, tst-array5-static.c,
	tst-array5dep.c, and tst-array5.exp.
	(tests): Add tst-array5.
	(tests-static): Add tst-array5-static.
	($(objpfx)tst-array5): New target.
	($(objpfx)tst-array5.out): Likewise.
	($(objpfx)tst-array5-static.out): Likewise.
	* elf/tst-array5-static.c: New file.
	* elf/tst-array5-static.exp: Likewise.
	* elf/tst-array5.c: Likewise.
	* elf/tst-array5.exp: Likewise.
	* elf/tst-array5dep.c: Likewise.
Diffstat (limited to 'csu')
-rw-r--r--csu/elf-init.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/csu/elf-init.c b/csu/elf-init.c
index 145eb3ea6b..4343b8a1ab 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;
 #endif
@@ -57,7 +61,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
@@ -69,7 +73,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
@@ -81,7 +85,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
 }