r5164 - in glibc-package/trunk/debian: . patches patches/mips
Author: aurel32
Date: 2012-02-15 21:39:54 +0000 (Wed, 15 Feb 2012)
New Revision: 5164
Added:
glibc-package/trunk/debian/patches/mips/cvs-dlopen-lazy.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
* patches/mips/cvs-dlopen-lazy.diff: new patch from upstream to resolve
race between dlopen and lazy binding on MIPS.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2012-02-13 14:53:15 UTC (rev 5163)
+++ glibc-package/trunk/debian/changelog 2012-02-15 21:39:54 UTC (rev 5164)
@@ -15,6 +15,8 @@
#659504.
* testsuite-checking/expected-results-arm-linux-gnueabihf-libc: new
file using the latest build as a reference.
+ * patches/mips/cvs-dlopen-lazy.diff: new patch from upstream to resolve
+ race between dlopen and lazy binding on MIPS.
-- Aurelien Jarno <aurel32@debian.org> Sun, 05 Feb 2012 11:12:52 +0100
Added: glibc-package/trunk/debian/patches/mips/cvs-dlopen-lazy.diff
===================================================================
--- glibc-package/trunk/debian/patches/mips/cvs-dlopen-lazy.diff (rev 0)
+++ glibc-package/trunk/debian/patches/mips/cvs-dlopen-lazy.diff 2012-02-15 21:39:54 UTC (rev 5164)
@@ -0,0 +1,61 @@
+2012-02-15 Viju Vincent <vijuvince@gmail.com>
+
+ * ports/sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Use locking
+ around calls to _dl_lookup_symbol_x.
+
+--- a/ports/sysdeps/mips/dl-trampoline.c
++++ b/ports/sysdeps/mips/dl-trampoline.c
+@@ -26,6 +26,7 @@
+ #include <elf.h>
+ #include <ldsodefs.h>
+ #include <dl-machine.h>
++#include <sysdep-cancel.h>
+
+ /* Get link map for callers object containing STUB_PC. */
+ static inline struct link_map *
+@@ -153,17 +154,44 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
+
+ if (version->hash != 0)
+ {
++ /* We need to keep the scope around so do some locking. This is
++ not necessary for objects which cannot be unloaded or when
++ we are not using any threads (yet). */
++ if (!RTLD_SINGLE_THREAD_P)
++ THREAD_GSCOPE_SET_FLAG ();
++
+ sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l,
+ &sym, l->l_scope, version,
+ ELF_RTYPE_CLASS_PLT, 0, 0);
++
++ /* We are done with the global scope. */
++ if (!RTLD_SINGLE_THREAD_P)
++ THREAD_GSCOPE_RESET_FLAG ();
++
+ break;
+ }
+ /* Fall through. */
+ }
+ case 0:
++ {
++ /* We need to keep the scope around so do some locking. This is
++ not necessary for objects which cannot be unloaded or when
++ we are not using any threads (yet). */
++ int flags = DL_LOOKUP_ADD_DEPENDENCY;
++ if (!RTLD_SINGLE_THREAD_P)
++ {
++ THREAD_GSCOPE_SET_FLAG ();
++ flags |= DL_LOOKUP_GSCOPE_LOCK;
++ }
++
+ sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym,
+ l->l_scope, 0, ELF_RTYPE_CLASS_PLT,
+- DL_LOOKUP_ADD_DEPENDENCY, 0);
++ flags, 0);
++
++ /* We are done with the global scope. */
++ if (!RTLD_SINGLE_THREAD_P)
++ THREAD_GSCOPE_RESET_FLAG ();
++ }
+ }
+
+ /* Currently value contains the base load address of the object
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2012-02-13 14:53:15 UTC (rev 5163)
+++ glibc-package/trunk/debian/patches/series 2012-02-15 21:39:54 UTC (rev 5164)
@@ -205,6 +205,7 @@
mips/local-r10k.diff
mips/submitted-rld_map.diff
mips/submitted-dl-platform.diff
+mips/cvs-dlopen-lazy.diff
powerpc/local-libgcc_eh-ld.so.diff
Reply to: