]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* elf/rtld.c (dl_main): Call _dl_init_linuxthreads_paths
authorJakub Jelinek <jakub@redhat.com>
Wed, 27 Apr 2005 11:40:21 +0000 (11:40 +0000)
committerJakub Jelinek <jakub@redhat.com>
Wed, 27 Apr 2005 11:40:21 +0000 (11:40 +0000)
if GLRO(dl_osversion) <= 0x20413.
* elf/dl-load.c (_dl_init_paths): Allocate one extra pointer in
rtld_search_dirs.dirs.
(_dl_init_linuxthreads_paths): New function.

ChangeLog
elf/dl-load.c
elf/rtld.c

index 3179b70d2572cc1d043ed3f8415eb02cece1859c..4d540f02f8fa110861663731d92014209debb979 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/rtld.c (dl_main): Call _dl_init_linuxthreads_paths
+       if GLRO(dl_osversion) <= 0x20413.
+       * elf/dl-load.c (_dl_init_paths): Allocate one extra pointer in
+       rtld_search_dirs.dirs.
+       (_dl_init_linuxthreads_paths): New function.
+
 2005-04-27  Roland McGrath  <roland@redhat.com>
 
        [BZ #877]
index d8b3a56d0dd01904012e8ecd6be0798f5018c375..791c0dcba5f7d096435ba93ea95cb14cc5fb751e 100644 (file)
@@ -644,7 +644,7 @@ _dl_init_paths (const char *llp)
 
   /* First set up the rest of the default search directory entries.  */
   aelem = rtld_search_dirs.dirs = (struct r_search_path_elem **)
-    malloc ((nsystem_dirs_len + 1) * sizeof (struct r_search_path_elem *));
+    malloc ((nsystem_dirs_len + 2) * sizeof (struct r_search_path_elem *));
   if (rtld_search_dirs.dirs == NULL)
     {
       errstring = N_("cannot create search path array");
@@ -780,6 +780,34 @@ _dl_init_paths (const char *llp)
 }
 
 
+void
+internal_function
+_dl_init_linuxthreads_paths (void)
+{
+  size_t cnt;
+  struct r_search_path_elem *elem, **aelem;
+
+  elem = malloc (sizeof (struct r_search_path_elem)
+                + ncapstr * sizeof (enum r_dir_status));
+  if (elem == NULL)
+    return;
+
+  for (aelem = rtld_search_dirs.dirs; *aelem; aelem++);
+  aelem[0] = elem;
+  aelem[1] = NULL;
+  elem->what = "linuxthreads search path";
+  elem->where = NULL;
+  elem->dirname = "/" DL_DST_LIB "/obsolete/linuxthreads/";
+  elem->dirnamelen = sizeof ("/" DL_DST_LIB "/obsolete/linuxthreads/") - 1;
+  if (elem->dirnamelen > max_dirnamelen)
+    max_dirnamelen = elem->dirnamelen;
+  for (cnt = 0; cnt < ncapstr; ++cnt)
+    elem->status[cnt] = unknown;
+  elem->next = NULL;
+  aelem[-1]->next = elem;
+}
+
+
 static void
 __attribute__ ((noreturn, noinline))
 lose (int code, int fd, const char *name, char *realname, struct link_map *l,
index 5d64d5a99e64e51feb548f84679bb3c6a9df463b..f3e55b6d9a693e5ee944c41944b5ab43f525dfc9 100644 (file)
@@ -1382,6 +1382,12 @@ ld.so does not support TLS, but program uses it!\n");
     }
 #endif
 
+  if (GLRO(dl_osversion) <= 0x20413)
+    {
+      extern void internal_function _dl_init_linuxthreads_paths (void);
+      _dl_init_linuxthreads_paths ();
+    }
+
   /* If LD_USE_LOAD_BIAS env variable has not been seen, default
      to not using bias for non-prelinked PIEs and libraries
      and using it for executables or prelinked PIEs or libraries.  */