This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][BZ #14577] Unload failed modules even if nodelete is specified.


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;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]