public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure.
@ 2021-08-27 23:25 Fangrui Song
  0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-27 23:25 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8205f0d10ebb5ddf8c43e8cede4a86f7744a0504

commit 8205f0d10ebb5ddf8c43e8cede4a86f7744a0504
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Mon Mar 3 17:03:35 2014 -0800

    For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure.

Diff:
---
 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 67b8e74b53..6cc626b5d3 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-27 23:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 23:25 [glibc/maskray/grte] For b/5836136, do dlsym(0, "_Unwind..."), i.e. ignore libgcc_s.so.1 dlopen failure Fangrui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).