aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 17:03:35 -0800
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-03 17:03:35 -0800
commit8205f0d10ebb5ddf8c43e8cede4a86f7744a0504 (patch)
tree5474c1d1afdfc4712f44fd6933531ca56c2b71d0
parent60548afc9f09eec306b34fed7a3242e621fb6547 (diff)
downloadglibc-8205f0d10ebb5ddf8c43e8cede4a86f7744a0504.zip
glibc-8205f0d10ebb5ddf8c43e8cede4a86f7744a0504.tar.gz
glibc-8205f0d10ebb5ddf8c43e8cede4a86f7744a0504.tar.bz2
For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure.
-rw-r--r--sysdeps/nptl/unwind-forcedunwind.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c
index 67b8e74..6cc626b 100644
--- a/sysdeps/nptl/unwind-forcedunwind.c
+++ b/sysdeps/nptl/unwind-forcedunwind.c
@@ -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