summary refs log tree commit diff
path: root/elf/dl-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-support.c')
-rw-r--r--elf/dl-support.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 21cd13e5cf..3333bf10fb 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -20,8 +20,10 @@
 /* This file defines some things that for the dynamic linker are defined in
    rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking.  */
 
+#include <link.h>
 #include <stdlib.h>
-
+#include <unistd.h>
+#include <dl-machine.h>
 
 extern char *__progname;
 char **_dl_argv = &__progname;	/* This is checked for some error messages.  */
@@ -30,15 +32,36 @@ char **_dl_argv = &__progname;	/* This is checked for some error messages.  */
    For the dynamic linker it is set by -rpath when linking.  */
 const char *_dl_rpath = DEFAULT_RPATH;
 
+/* Name of the architecture.  */
+const char *_dl_platform;
+size_t _dl_platformlen;
+
 /* If nonzero print warnings about problematic situations.  */
 int _dl_verbose;
 
+/* Structure to store information about search paths.  */
+struct r_search_path *_dl_search_paths;
 
-static void init_verbose (void) __attribute__ ((unused));
+
+static void non_dynamic_init (void) __attribute__ ((unused));
 
 static void
-init_verbose (void)
+non_dynamic_init (void)
 {
   _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
+
+  /* Initialize the data structures for the search paths for shared
+     objects.  */
+  _dl_init_paths ();
+
+#ifdef DL_PLATFORM_INIT
+  DL_PLATFORM_INIT;
+#endif
+
+  /* Now determine the length of the platform string.  */
+  if (_dl_platform != NULL)
+    _dl_platformlen = strlen (_dl_platform);
+
+  _dl_pagesize = __getpagesize ();
 }
-text_set_element (__libc_subinit, init_verbose);
+text_set_element (__libc_subinit, non_dynamic_init);