diff options
author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2004-08-25 14:22:05 +0000 |
---|---|---|
committer | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2004-08-25 14:22:05 +0000 |
commit | 8e4a1b8a993e8323f39dbc8f66a14ed0319259ad (patch) | |
tree | a8e1a8048f85cfa2642a8a77a43f4610a4c4a007 /ldso | |
parent | 25a92c77e937e4ac1a2ba4eb4886125bf3fc856e (diff) |
Hopefully fix Laszlo and Jacobs dlopen problem.
Diffstat (limited to 'ldso')
-rw-r--r-- | ldso/ldso/ldso.c | 2 | ||||
-rw-r--r-- | ldso/libdl/libdl.c | 5 |
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; |