summaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index d8b3a56d0d..791c0dcba5 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -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,