about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-04-03 17:13:21 +0000
committerRoland McGrath <roland@gnu.org>2000-04-03 17:13:21 +0000
commit9129b9874db71c9325ee0772810fee8a5e4a82f8 (patch)
tree199903abf5207c654f89562b45447f7e1abedae8 /sysdeps
parent152e7964d695b4f6e23bf861f0771dcf7c52aa01 (diff)
downloadglibc-9129b9874db71c9325ee0772810fee8a5e4a82f8.tar.gz
glibc-9129b9874db71c9325ee0772810fee8a5e4a82f8.tar.xz
glibc-9129b9874db71c9325ee0772810fee8a5e4a82f8.zip
2000-04-03 Roland McGrath <roland@baalperazim.frob.com>
	* sysdeps/mach/hurd/i386/init-first.c (init): Don't set __environ
	here, before we might move the stack.
	(posixland_init): Set __libc_argc, __libc_argc, and __environ here.
	(init1): And not here.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/i386/init-first.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index 505c9ca328..b26a9da7dc 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -56,12 +56,16 @@ DEFINE_HOOK (_hurd_preinit_hook, (void));
 static void
 posixland_init (int argc, char **argv, char **envp)
 {
-  __libc_init (argc, argv, __environ);
+  __libc_argc = argc;
+  __libc_argv = argv;
+  __environ = envp;
+
+  __libc_init (argc, argv, envp);
 
   /* This is a hack to make the special getopt in GNU libc working.  */
-  __getopt_clean_environment (__environ);
+  __getopt_clean_environment (envp);
 
-#ifdef PIC
+#ifdef SHARED
   __libc_global_ctors ();
 #endif
 }
@@ -74,9 +78,6 @@ init1 (int argc, char *arg0, ...)
   char **envp = &argv[argc + 1];
   struct hurd_startup_data *d;
 
-  __libc_argc = argc;
-  __libc_argv = argv;
-
   while (*envp)
     ++envp;
   d = (void *) ++envp;
@@ -131,7 +132,6 @@ init (int *data)
   memset (threadvars, 0, sizeof threadvars);
   __hurd_threadvar_stack_offset = (unsigned long int) threadvars;
 
-  __environ = envp;
   while (*envp)
     ++envp;
   d = (void *) ++envp;