From 1fc074913b0d1f0d57afb585daa41df47ea1ac31 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 23 Sep 2004 07:45:38 +0000 Subject: Update. 2004-09-23 Ulrich Drepper * sysdeps/generic/bits/dlfcn.h: Add RTLD_DEEPBIND. * elf/dl-object.c (_dl_new_object): Add new parameter mode. If mode has RTLD_DEEPBIND set add local searchlist before global scope. * sysdeps/generic/ldsodefs.h (_dl_new_object): Adjust prototype. * elf/rtld.c: Adjust callers of _dl_new_object. * elf/dl-load.c: Likewise. (_dl_map_object_from_fd): If RTLD_DEEPBIND is used, don't do anything for DF_SYMBOLIC. * elf/dl-open.c (dl_open_writer): Pass RTLD_DEEPBIND flag on to _dl_map_object_deps. * elf/tst-deep1.c: New file. * elf/tst-deep1mod1.c: New file. * elf/tst-deep1mod2.c: New file. * elf/tst-deep1mod3.c: New file. * elf/Makefile: Add rules to build and run new tests. * elf/dl-deps.c: Pretty printing. --- elf/dl-object.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'elf/dl-object.c') diff --git a/elf/dl-object.c b/elf/dl-object.c index 52131181b3..91b1fa2187 100644 --- a/elf/dl-object.c +++ b/elf/dl-object.c @@ -32,7 +32,7 @@ struct link_map * internal_function _dl_new_object (char *realname, const char *libname, int type, - struct link_map *loader) + struct link_map *loader, int mode) { struct link_map *l; int idx; @@ -95,7 +95,15 @@ _dl_new_object (char *realname, const char *libname, int type, /* Insert the scope if it isn't the global scope we already added. */ if (idx == 0 || &loader->l_searchlist != new->l_scope[0]) - new->l_scope[idx] = &loader->l_searchlist; + { + if ((mode & RTLD_DEEPBIND) != 0 && idx != 0) + { + new->l_scope[1] = new->l_scope[0]; + idx = 0; + } + + new->l_scope[idx] = &loader->l_searchlist; + } new->l_local_scope[0] = &new->l_searchlist; -- cgit v1.2.3