summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/dl-hash.c2
-rw-r--r--ldso/libdl/libdl.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/ldso/ldso/dl-hash.c b/ldso/ldso/dl-hash.c
index 109ee0e76..bac4a506a 100644
--- a/ldso/ldso/dl-hash.c
+++ b/ldso/ldso/dl-hash.c
@@ -173,6 +173,8 @@ char *_dl_find_hash(const char *name, struct dyn_elf *rpnt, int type_class)
for (; rpnt; rpnt = rpnt->next) {
tpnt = rpnt->dyn;
+ if (!(tpnt->rtld_flags & RTLD_GLOBAL))
+ continue;
/* Don't search the executable when resolving a copy reloc. */
if ((type_class & ELF_RTYPE_CLASS_COPY) && tpnt->libtype == elf_executable)
continue;
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 6c4e9843b..8199a7598 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -223,13 +223,14 @@ void *dlopen(const char *libname, int flag)
_dl_memset (dyn_ptr->next, 0, sizeof (struct dyn_elf));
dyn_ptr = dyn_ptr->next;
dyn_ptr->dyn = tpnt1;
- tpnt->rtld_flags |= RTLD_GLOBAL;
if (!tpnt1) {
tpnt1 = _dl_load_shared_library(0, &rpnt, tcurr, lpntstr, 0);
+ dyn_ptr->dyn = tpnt1;
if (!tpnt1)
goto oops;
- dyn_ptr->dyn = tpnt1;
+ tpnt1->rtld_flags |= RTLD_GLOBAL;
} else {
+ tpnt1->rtld_flags |= RTLD_GLOBAL;
tpnt1->usage_count++;
}
}