summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch')
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch83
1 files changed, 0 insertions, 83 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch b/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch
deleted file mode 100644
index 16e48b1bca..0000000000
--- a/meta/recipes-core/uclibc/uclibc-git/fix_libdl.patch
+++ /dev/null
@@ -1,83 +0,0 @@
1Defer removal of the local scope of a dl-opened library after
2all the destructors (of itself and related dependencies) are actually
3get unloaded, otherwise any function registered via atexit()
4won't be resolved.
5
6Signed-off-by: Khem Raj <raj.khem at gmail.com>
7Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
8Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
9---
10 ldso/libdl/libdl.c | 33 +++++++++++++++++++++------------
11 1 files changed, 21 insertions(+), 12 deletions(-)
12
13
14Upstream-Status: Pending
15
16Index: git/ldso/libdl/libdl.c
17===================================================================
18--- git.orig/ldso/libdl/libdl.c 2012-01-17 17:38:44.930821794 -0800
19+++ git/ldso/libdl/libdl.c 2012-01-17 17:39:02.754822656 -0800
20@@ -780,7 +780,9 @@
21 struct dyn_elf *handle;
22 unsigned int end = 0, start = 0xffffffff;
23 unsigned int i, j;
24- struct r_scope_elem *ls;
25+ struct r_scope_elem *ls, *ls_next = NULL;
26+ struct elf_resolve **handle_rlist;
27+
28 #if defined(USE_TLS) && USE_TLS
29 bool any_tls = false;
30 size_t tls_free_start = NO_TLS_OFFSET;
31@@ -813,6 +815,19 @@
32 free(handle);
33 return 0;
34 }
35+
36+ /* Store the handle's local scope array for later removal */
37+ handle_rlist = handle->dyn->symbol_scope.r_list;
38+
39+ /* Store references to the local scope entries for later removal */
40+ for (ls = &_dl_loaded_modules->symbol_scope; ls && ls->next; ls = ls->next)
41+ if (ls->next->r_list[0] == handle->dyn) {
42+ break;
43+ }
44+ /* ls points to the previous local symbol scope */
45+ if(ls && ls->next)
46+ ls_next = ls->next->next;
47+
48 /* OK, this is a valid handle - now close out the file */
49 for (j = 0; j < handle->init_fini.nlist; ++j) {
50 tpnt = handle->init_fini.init_fini[j];
51@@ -974,16 +989,6 @@
52 }
53 }
54
55- if (handle->dyn == tpnt) {
56- /* Unlink the local scope from global one */
57- for (ls = &_dl_loaded_modules->symbol_scope; ls; ls = ls->next)
58- if (ls->next->r_list[0] == tpnt) {
59- _dl_if_debug_print("removing symbol_scope: %s\n", tpnt->libname);
60- break;
61- }
62- ls->next = ls->next->next;
63- }
64-
65 /* Next, remove tpnt from the global symbol table list */
66 if (_dl_symbol_tables) {
67 if (_dl_symbol_tables->dyn == tpnt) {
68@@ -1005,10 +1010,14 @@
69 }
70 }
71 free(tpnt->libname);
72- free(tpnt->symbol_scope.r_list);
73 free(tpnt);
74 }
75 }
76+ /* Unlink and release the handle's local scope from global one */
77+ if(ls)
78+ ls->next = ls_next;
79+ free(handle_rlist);
80+
81 for (rpnt1 = handle->next; rpnt1; rpnt1 = rpnt1_tmp) {
82 rpnt1_tmp = rpnt1->next;
83 free(rpnt1);