summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch')
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch133
1 files changed, 133 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch b/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch
new file mode 100644
index 0000000000..1c30c9d833
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.15/glibc-2.14-libdl-crash.patch
@@ -0,0 +1,133 @@
1Without this patch programs using alsa-lib crash (alsamixer for example).
2Removed Copyright reverts
3
4Upstream-Status: Pending
5
6http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=675155e9
7http://sourceware.org/ml/libc-alpha/2011-06/msg00006.html
8
9many distributions are using this already
10http://chakra-project.org/ccr/packages/glibc/glibc/PKGBUILD
11http://mailman.archlinux.org/pipermail/arch-commits/2011-June/137142.html
12http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/glibc/current/SOURCES/glibc-2.14-libdl-crash.patch?view=markup&pathrev=691343
13http://repos.archlinuxppc.org/wsvn/filedetails.php?repname=packages&path=%2Fglibc%2Ftrunk%2Fglibc-2.14-libdl-crash.patch
14
15Index: libc/elf/dl-close.c
16===================================================================
17--- libc.orig/elf/dl-close.c 2011-12-05 20:16:38.000000000 -0800
18+++ libc/elf/dl-close.c 2011-12-05 20:17:15.863326893 -0800
19@@ -119,17 +119,8 @@
20 if (map->l_direct_opencount > 0 || map->l_type != lt_loaded
21 || dl_close_state != not_pending)
22 {
23- if (map->l_direct_opencount == 0)
24- {
25- if (map->l_type == lt_loaded)
26- dl_close_state = rerun;
27- else if (map->l_type == lt_library)
28- {
29- struct link_map **oldp = map->l_initfini;
30- map->l_initfini = map->l_orig_initfini;
31- _dl_scope_free (oldp);
32- }
33- }
34+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded)
35+ dl_close_state = rerun;
36
37 /* There are still references to this object. Do nothing more. */
38 if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
39Index: libc/elf/dl-deps.c
40===================================================================
41--- libc.orig/elf/dl-deps.c 2011-12-05 20:16:38.000000000 -0800
42+++ libc/elf/dl-deps.c 2011-12-05 20:19:33.179326877 -0800
43@@ -478,6 +478,7 @@
44 nneeded * sizeof needed[0]);
45 atomic_write_barrier ();
46 l->l_initfini = l_initfini;
47+ l->l_free_initfini = 1;
48 }
49
50 /* If we have no auxiliary objects just go on to the next map. */
51@@ -678,6 +679,7 @@
52 l_initfini[nlist] = NULL;
53 atomic_write_barrier ();
54 map->l_initfini = l_initfini;
55+ map->l_free_initfini = 1;
56 if (l_reldeps != NULL)
57 {
58 atomic_write_barrier ();
59@@ -686,7 +688,7 @@
60 _dl_scope_free (old_l_reldeps);
61 }
62 if (old_l_initfini != NULL)
63- map->l_orig_initfini = old_l_initfini;
64+ _dl_scope_free (old_l_initfini);
65
66 if (errno_reason)
67 _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
68Index: libc/elf/dl-libc.c
69===================================================================
70--- libc.orig/elf/dl-libc.c 2011-10-22 09:34:03.000000000 -0700
71+++ libc/elf/dl-libc.c 2011-12-05 20:17:15.863326893 -0800
72@@ -265,13 +265,13 @@
73
74 for (Lmid_t ns = 0; ns < GL(dl_nns); ++ns)
75 {
76- /* Remove all additional names added to the objects. */
77 for (l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
78 {
79 struct libname_list *lnp = l->l_libname->next;
80
81 l->l_libname->next = NULL;
82
83+ /* Remove all additional names added to the objects. */
84 while (lnp != NULL)
85 {
86 struct libname_list *old = lnp;
87@@ -279,6 +279,10 @@
88 if (! old->dont_free)
89 free (old);
90 }
91+
92+ /* Free the initfini dependency list. */
93+ if (l->l_free_initfini)
94+ free (l->l_initfini);
95 }
96
97 if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
98Index: libc/elf/rtld.c
99===================================================================
100--- libc.orig/elf/rtld.c 2011-10-22 09:34:03.000000000 -0700
101+++ libc/elf/rtld.c 2011-12-05 20:17:15.863326893 -0800
102@@ -2264,6 +2264,7 @@
103 lnp->dont_free = 1;
104 lnp = lnp->next;
105 }
106+ l->l_free_initfini = 0;
107
108 if (l != &GL(dl_rtld_map))
109 _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
110Index: libc/include/link.h
111===================================================================
112--- libc.orig/include/link.h 2011-10-22 09:32:35.000000000 -0700
113+++ libc/include/link.h 2011-12-05 20:17:15.863326893 -0800
114@@ -192,6 +192,9 @@
115 during LD_TRACE_PRELINKING=1
116 contains any DT_SYMBOLIC
117 libraries. */
118+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
119+ freed, ie. not allocated with
120+ the dummy malloc in ld.so. */
121
122 /* Collected information about own RPATH directories. */
123 struct r_search_path_struct l_rpath_dirs;
124@@ -240,9 +243,6 @@
125
126 /* List of object in order of the init and fini calls. */
127 struct link_map **l_initfini;
128- /* The init and fini list generated at startup, saved when the
129- object is also loaded dynamically. */
130- struct link_map **l_orig_initfini;
131
132 /* List of the dependencies introduced through symbol binding. */
133 struct link_map_reldeps