Просмотр исходного кода

dlclose fix

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
Waldemar Brodkorb 10 лет назад
Родитель
Сommit
cc04ab27ba
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      ldso/libdl/libdl.c

+ 2 - 2
ldso/libdl/libdl.c

@@ -964,8 +964,8 @@ static int do_dlclose(void *vhandle, int need_fini)
 
 
 					dtv_t *dtv = THREAD_DTV ();
 					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
 						/* Note that free is called for NULL is well.  We
 						deallocate even if it is this dtv entry we are
 						deallocate even if it is this dtv entry we are
 						supposed to load.  The reason is that we call
 						supposed to load.  The reason is that we call