]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure.
authorPaul Pluzhnikov <ppluzhnikov@google.com>
Tue, 4 Mar 2014 01:03:35 +0000 (17:03 -0800)
committerPaul Pluzhnikov <ppluzhnikov@google.com>
Tue, 4 Mar 2014 01:03:35 +0000 (17:03 -0800)
sysdeps/nptl/unwind-forcedunwind.c

index 67b8e74b5367c1a21b290c3164f3448fe283d25d..6cc626b5d305b361e565a37259a52d768be7c376 100644 (file)
@@ -23,6 +23,7 @@
 #include <sysdep.h>
 #include <gnu/lib-names.h>
 #include <unwind-resume.h>
+#include <ldsodefs.h>
 
 static void *libgcc_s_handle;
 void (*__libgcc_s_resume) (struct _Unwind_Exception *exc)
@@ -51,6 +52,14 @@ pthread_cancel_init (void)
 
   handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
 
+  /* Google-local: b/5836136 */
+  /* This is kind of weird to do, but has proven useful in cases where
+     the unwind support may be statically linked into us; we don't
+     want to pull in a redundant shared libgcc, we just want to use
+     the symbols we already have.  */
+  if (handle == NULL)
+    handle = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
+
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
       || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL