From 8205f0d10ebb5ddf8c43e8cede4a86f7744a0504 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Mon, 3 Mar 2014 17:03:35 -0800 Subject: [PATCH] For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure. --- sysdeps/nptl/unwind-forcedunwind.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.47.2