aboutsummaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/libdl.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-04-29 09:04:48 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-04-29 09:08:03 +0000
commit49dabb360ce6c2d5a6d4e1eefc136be8a9bfd1e7 (patch)
tree26f835b50a98c39c5265828ae48899d0e7bdd073 /main/libc0.9.32/libdl.patch
parent3dc4cfbfd38fcf233232f22583a6f635eb148e0e (diff)
downloadaports-49dabb360ce6c2d5a6d4e1eefc136be8a9bfd1e7.tar.bz2
aports-49dabb360ce6c2d5a6d4e1eefc136be8a9bfd1e7.tar.xz
main/libc0.9.32: another dlopen/dlclose patch from Timo
This should fix issue with sdl[1] and apps that does lots of dlopen/dlclose calls with complicated deps. [1] see commit be91866229a76e73f1ecdbdbfec83b8e69cb6e69
Diffstat (limited to 'main/libc0.9.32/libdl.patch')
-rw-r--r--main/libc0.9.32/libdl.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/main/libc0.9.32/libdl.patch b/main/libc0.9.32/libdl.patch
new file mode 100644
index 0000000000..f8a90ffa16
--- /dev/null
+++ b/main/libc0.9.32/libdl.patch
@@ -0,0 +1,26 @@
+diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
+index 95a0650..3cfcb85 100644
+--- a/ldso/libdl/libdl.c
++++ b/ldso/libdl/libdl.c
+@@ -544,8 +544,18 @@ static void *do_dlopen(const char *libname, int flag)
+ * to the GOT tables. We need to do this in reverse order so that COPY
+ * directives work correctly */
+
+- /* Get the tail of the list */
+- for (ls = &_dl_loaded_modules->symbol_scope; ls && ls->next; ls = ls->next);
++ /* Extend the global scope by adding the local scope of the dlopened DSO.
++ * But only if it's not there. It can happen under certain cases that the
++ * DSO had refcount = 0, but was already loaded. (NODELETE flag is set, or
++ * it is pulled in via both NEEDED dependency and explicit dlopen()). */
++ for (ls = &_dl_loaded_modules->symbol_scope; ; ls = ls->next) {
++ if (ls == &dyn_chain->dyn->symbol_scope)
++ break;
++ if (ls->next == NULL) {
++ ls->next = &dyn_chain->dyn->symbol_scope;
++ break;
++ }
++ }
+
+ /* Extend the global scope by adding the local scope of the dlopened DSO. */
+ ls->next = &dyn_chain->dyn->symbol_scope;
+