Magellan Linux

Contents of /trunk/glibc/patches/glibc-2.13-dlclose-search-reset.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1557 - (show annotations) (download)
Tue Nov 8 21:38:07 2011 UTC (12 years, 5 months ago) by niro
File size: 1338 byte(s)
added dlclose patch
1 In some cases unloading a module with dlclose can fail to update the symbol
2 search list for the remaining modules, leading to a situation where symbols
3 are referenced after the library has been removed from the symbol map. The
4 most commonly encountered example of this is the error_category destructor
5 in libstdc++ not getting called until the exit finalizers are run, resulting
6 in:
7
8 symbol lookup error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.0/libstdc++.so.6:
9 undefined symbol: _ZNSt14error_categoryD2Ev, version GLIBCXX_3.4.15
10
11 https://bugs.gentoo.org/364077
12 https://bugzilla.redhat.com/593675
13 http://sourceware.org/ml/libc-hacker/2010-05/msg00007.html
14 http://gcc.gnu.org/ml/gcc-help/2011-07/msg00099.html
15
16
17 2010-05-26 Andreas Schwab <schwab@redhat.com>
18
19 * elf/dl-close.c (_dl_close_worker): Reset private search list if
20 it wasn't used.
21
22 --- a/elf/dl-close.c
23 +++ b/elf/dl-close.c
24 @@ -421,6 +421,13 @@ _dl_close_worker (struct link_map *map)
25
26 imap->l_scope_max = new_size;
27 }
28 + else if (new_list != NULL)
29 + {
30 + /* We didn't change the scope array, so reset the search
31 + list. */
32 + imap->l_searchlist.r_list = NULL;
33 + imap->l_searchlist.r_nlist = 0;
34 + }
35
36 /* The loader is gone, so mark the object as not having one.
37 Note: l_idx != IDX_STILL_USED -> object will be removed. */