summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/ldso/ldso.c2
-rw-r--r--ldso/libdl/libdl.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index bd0b3d8de..8730da8a5 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -139,7 +139,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
tpnt->ppnt = myppnt = (ElfW(Phdr) *) (load_addr + epnt->e_phoff);
for (j = 0; j < epnt->e_phnum; j++, myppnt++) {
if (myppnt->p_type == PT_DYNAMIC) {
- tpnt->dynamic_addr = (ElfW(Dyn) *)myppnt->p_vaddr + load_addr;
+ tpnt->dynamic_addr = (ElfW(Dyn) *)(myppnt->p_vaddr + load_addr);
tpnt->dynamic_size = myppnt->p_filesz;
}
}
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index d1274e3ff..6c4e9843b 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -179,8 +179,11 @@ void *dlopen(const char *libname, int flag)
if(_dl_debug)
fprintf(stderr, "Trying to dlopen '%s'\n", (char*)libname);
#endif
- if (!(tpnt = _dl_check_if_named_library_is_loaded((char *)libname, 0)))
+ tpnt = _dl_check_if_named_library_is_loaded((char *)libname, 0);
+ if (!(tpnt))
tpnt = _dl_load_shared_library(0, &rpnt, tfrom, (char*)libname, 0);
+ else
+ tpnt->usage_count++;
if (tpnt == NULL) {
_dl_unmap_cache();
return NULL;