2000-10-24 Ulrich Drepper <drepper@redhat.com>
+ * elf/dl-close.c (_dl_close): Don't free memory for global scope
+ list immediately when empty. Move code to...
+ (free_mem): ...here. Called as part of __libc_subfreeres list.
+
* elf/dl-deps.c (_dl_map_object_deps): Put l_initfini array before
r_list array in allocated memory.
* elf/dl-close.c (_dl_close): Optimize access to l_initfini list
}
}
+ /* Notify the debugger those objects are finalized and gone. */
+ _r_debug.r_state = RT_CONSISTENT;
+ _dl_debug_state ();
+
/* Now we can perhaps also remove the modules for which we had
dependencies because of symbol lookup. */
if (__builtin_expect (rellist != NULL, 0))
free (list);
+ /* Release the lock. */
+ __libc_lock_unlock (_dl_load_lock);
+}
+
+
+static void
+free_mem (void)
+{
if (__builtin_expect (_dl_global_scope_alloc, 0) != 0
&& _dl_main_searchlist->r_nlist == _dl_initial_searchlist.r_nlist)
{
/* Now free the old map. */
free (old);
}
-
- /* Notify the debugger those objects are finalized and gone. */
- _r_debug.r_state = RT_CONSISTENT;
- _dl_debug_state ();
-
- /* Release the lock. */
- __libc_lock_unlock (_dl_load_lock);
}
+text_set_element (__libc_subfreeres, free_mem);