From: Paul Pluzhnikov Date: Tue, 4 Mar 2014 01:03:35 +0000 (-0800) Subject: For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8205f0d10ebb5ddf8c43e8cede4a86f7744a0504;p=thirdparty%2Fglibc.git For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure. --- diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c index 67b8e74b536..6cc626b5d30 100644 --- a/sysdeps/nptl/unwind-forcedunwind.c +++ b/sysdeps/nptl/unwind-forcedunwind.c @@ -23,6 +23,7 @@ #include #include #include +#include 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