OSDN Git Service

dlclose fix
authorWaldemar Brodkorb <wbx@openadk.org>
Sun, 13 Dec 2015 22:49:06 +0000 (23:49 +0100)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>
Thu, 17 Dec 2015 20:16:43 +0000 (21:16 +0100)
Patch is from Timo Teras

Refs.:
 http://lists.uclibc.org/pipermail/uclibc/2012-October/047059.html
 http://git.alpinelinux.org/cgit/aports/tree/main/libc0.9.32/uclibc-dlclose-fix.patch

ldso/libdl/libdl.c

index 388e3c7..2c4b064 100644 (file)
@@ -964,8 +964,8 @@ static int do_dlclose(void *vhandle, int need_fini)
 
                                        dtv_t *dtv = THREAD_DTV ();
 
-                                       _dl_assert(!(dtv[tls_lmap->l_tls_modid].pointer.is_static));
-                                       if (dtv[tls_lmap->l_tls_modid].pointer.val != TLS_DTV_UNALLOCATED) {
+                                       if (!(dtv[tls_lmap->l_tls_modid].pointer.is_static) &&
+                                           dtv[tls_lmap->l_tls_modid].pointer.val != TLS_DTV_UNALLOCATED) {
                                                /* Note that free is called for NULL is well.  We
                                                deallocate even if it is this dtv entry we are
                                                supposed to load.  The reason is that we call