summaryrefslogtreecommitdiff
path: root/ldso/libdl
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/libdl')
-rw-r--r--ldso/libdl/Makefile.in2
-rw-r--r--ldso/libdl/libdl.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/ldso/libdl/Makefile.in b/ldso/libdl/Makefile.in
index 64a320e1c..39db7a876 100644
--- a/ldso/libdl/Makefile.in
+++ b/ldso/libdl/Makefile.in
@@ -44,7 +44,7 @@ lib-so-y += $(top_builddir)lib/libdl.so
objclean-y += CLEAN_ldso/libdl
$(top_builddir)lib/libdl.so: $(libdl_OUT)/libdl_so.a $(libc.depend)
- $(call link.so,$(libdl_FULL_NAME),$(MAJOR_VERSION))
+ $(call link.so,$(libdl_FULL_NAME),$(ABI_VERSION))
$(libdl_OUT)/libdl_so.a: $(libdl-so-y)
$(Q)$(RM) $@
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 05a68ddcc..f19a0151e 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -736,7 +736,7 @@ static int do_dlclose(void *vhandle, int need_fini)
_dl_handles = rpnt->next_handle;
_dl_if_debug_print("%s: usage count: %d\n",
handle->dyn->libname, handle->dyn->usage_count);
- if (handle->dyn->usage_count != 1) {
+ if (handle->dyn->usage_count != 1 || (handle->dyn->rtld_flags & RTLD_NODELETE)) {
handle->dyn->usage_count--;
free(handle);
return 0;
@@ -744,7 +744,8 @@ static int do_dlclose(void *vhandle, int need_fini)
/* OK, this is a valid handle - now close out the file */
for (j = 0; j < handle->init_fini.nlist; ++j) {
tpnt = handle->init_fini.init_fini[j];
- if (--tpnt->usage_count == 0) {
+ tpnt->usage_count--;
+ if (tpnt->usage_count == 0 && !(tpnt->rtld_flags & RTLD_NODELETE)) {
if ((tpnt->dynamic_info[DT_FINI]
|| tpnt->dynamic_info[DT_FINI_ARRAY])
&& need_fini