This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][BZ #14577] Unload failed modules even if nodelete is specified.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Sat, 26 Oct 2013 10:44:10 +0200
- Subject: [RFC][BZ #14577] Unload failed modules even if nodelete is specified.
- Authentication-results: sourceware.org; auth=none
Hi, this bug report want to always unload failed modules. It caused
second dlopen to succeed which leads to broken behaviour.
Module in question was marked as NODELETE. One possibiltity could be
detect change tests that also check if object was loaded like one below.
Second would be refactor dl-open so that corresponding DF_1_NODELETE are
set just before exit.
Comments, ideas?
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 172847e..57ba863 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -170,7 +170,7 @@ _dl_close_worker (struct link_map *map)
/* Check whether this object is still used. */
if (l->l_type == lt_loaded
&& l->l_direct_opencount == 0
- && (l->l_flags_1 & DF_1_NODELETE) == 0
+ && ((l->l_flags_1 & DF_1_NODELETE) == 0 || !l->l_init_called)
&& !used[done_index])
continue;