about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-07 02:00:21 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-07 02:00:21 +0000
commite4a5f77de683578d85fe7621ebdaee76dd3df89c (patch)
tree9574d82850d01235549c30c0c68473371a741ef7 /sysdeps
parentbf798a9534d3d0a374f456dcf2a1b93f15b2849c (diff)
downloadglibc-e4a5f77de683578d85fe7621ebdaee76dd3df89c.tar.gz
glibc-e4a5f77de683578d85fe7621ebdaee76dd3df89c.tar.xz
glibc-e4a5f77de683578d85fe7621ebdaee76dd3df89c.zip
Update.
2001-01-05  H.J. Lu  <hjl@gnu.org>

	* elf/dl-support.c (non_dynamic_init): Move the auxiliary
	vector checking to ...
	(_dl_aux_init): Here. New function. Defined only if
	HAVE_AUX_VECTOR is defined.

	* sysdeps/generic/libc-start.c (__libc_start_main): Call
	_dl_aux_init for static binaries if HAVE_AUX_VECTOR is defined.

	* sysdeps/powerpc/elf/libc-start.c (__libc_start_main): Call
	_dl_aux_init.

	* sysdeps/unix/sysv/linux/ldsodefs.h (DL_FIND_AUXV): Removed.
	(HAVE_AUX_VECTOR): Defined.
	(_dl_aux_init): Declared.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/libc-start.c11
-rw-r--r--sysdeps/powerpc/elf/libc-start.c1
-rw-r--r--sysdeps/unix/sysv/linux/ldsodefs.h15
3 files changed, 17 insertions, 10 deletions
diff --git a/sysdeps/generic/libc-start.c b/sysdeps/generic/libc-start.c
index c4b8bc6809..fa394b45f2 100644
--- a/sysdeps/generic/libc-start.c
+++ b/sysdeps/generic/libc-start.c
@@ -59,6 +59,10 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
 #endif
 
 #ifndef SHARED
+# ifdef HAVE_AUX_VECTOR
+  void *__unbounded *__unbounded auxvec;
+# endif
+
   /* The next variable is only here to work around a bug in gcc <= 2.7.2.2.
      If the address would be taken inside the expression the optimizer
      would try to be too smart and throws it away.  Grrr.  */
@@ -85,6 +89,13 @@ BP_SYM (__libc_start_main) (int (*main) (int, char **, char **),
      loader did the work already.  */
   if (__builtin_expect (__libc_enable_secure, 0))
     __libc_check_standard_fds ();
+
+# ifdef HAVE_AUX_VECTOR
+  for (auxvec = (void *__unbounded *__unbounded) ubp_ev;
+       *auxvec; auxvec++);
+  ++auxvec;
+  _dl_aux_init ((ElfW(auxv_t) *) auxvec);
+# endif
 #endif
 
   /* Register the destructor of the dynamic linker if there is any.  */
diff --git a/sysdeps/powerpc/elf/libc-start.c b/sysdeps/powerpc/elf/libc-start.c
index 6a80bc7ee4..a05bda2219 100644
--- a/sysdeps/powerpc/elf/libc-start.c
+++ b/sysdeps/powerpc/elf/libc-start.c
@@ -76,6 +76,7 @@ BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
       while (*(char *__unbounded *__unbounded) auxvec != NULL)
 	++auxvec;
       ++auxvec;
+      _dl_aux_init ((ElfW(auxv_t) *) auxvec);
       rtld_fini = NULL;
     }
 
diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h
index d5ef2e2643..1bfe6c38af 100644
--- a/sysdeps/unix/sysv/linux/ldsodefs.h
+++ b/sysdeps/unix/sysv/linux/ldsodefs.h
@@ -24,15 +24,10 @@
 
 /* Now define our stuff.  */
 
-/* Locating the auxiliary vector.  */
-#ifndef DL_FIND_AUXV
-# define DL_FIND_AUXV(auxp, envp) \
-  do { \
-    void **_tmp; \
-    for (_tmp = (void **) (envp); *_tmp; ++_tmp) \
-      continue; \
-    (auxp) = (void *) ++_tmp; \
-  } while (0)
-#endif
+/* We have the auxiliary vector.  */
+#define HAVE_AUX_VECTOR
+
+/* Used by static binaries to check the auxiliary vector.  */
+extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
 
 #endif /* ldsodefs.h */