summaryrefslogtreecommitdiff
path: root/ldso/libdl/libdl.c
diff options
context:
space:
mode:
authorLeonid Lisovskiy <lly.dev@gmail.com>2016-06-20 20:29:44 +0300
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-06-22 08:02:51 +0200
commit0bc1394750885d4e4b2064aff6c48dd542c6f4b8 (patch)
treef7d2c3930d353dabfcae271be2bd5fc956869e06 /ldso/libdl/libdl.c
parentfcbbde85024f494d7ba573bf8a4474755452efdd (diff)
ldso: Consistently set & use DL_OPENED flag in both ld.so and libdl
Previously, DL_OPENED flag was set in libdl only and never used. Set it centralized in _dl_load_elf_shared_library() & use it in both ld.so and libdl. Additionally, rename it to DL_OPENED2 for clarity. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Diffstat (limited to 'ldso/libdl/libdl.c')
-rw-r--r--ldso/libdl/libdl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 42a09a8bb..489c78759 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -396,7 +396,7 @@ static void *do_dlopen(const char *libname, int flag, ElfW(Addr) from)
dyn_chain->next_handle = _dl_handles;
_dl_handles = dyn_ptr = dyn_chain;
- if (tpnt->usage_count > 1) {
+ if (tpnt->init_flag & DL_OPENED2) {
_dl_if_debug_print("Lib: %s already opened\n", libname);
/* see if there is a handle from a earlier dlopen */
for (handle = _dl_handles->next_handle; handle; handle = handle->next_handle) {
@@ -412,8 +412,6 @@ static void *do_dlopen(const char *libname, int flag, ElfW(Addr) from)
return dyn_chain;
}
- tpnt->init_flag |= DL_OPENED;
-
_dl_if_debug_print("Looking for needed libraries\n");
nlist = 0;
runp = alloca(sizeof(*runp));