public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel
@ 2018-01-10 10:49 Florian Weimer
  2018-01-10 11:10 ` Adhemerval Zanella
  2018-01-10 19:09 ` Carlos O'Donell
  0 siblings, 2 replies; 7+ messages in thread
From: Florian Weimer @ 2018-01-10 10:49 UTC (permalink / raw)
  To: libc-alpha

Disabling lazy binding reduces stack usage during unwinding.

Note that RTLD_NOW only makes a difference if libgcc.so has not
already been loaded, so this is only a partial fix.

2018-01-10  Florian Weimer  <fweimer@redhat.com>

	[BZ #22636]
	* sysdeps/nptl/unwind-forcedunwind.c (pthread_cancel_init): Open
	libgcc.so with RTLD_NOW, to avoid lazy binding during unwind.

diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c
index ab4350de99..67b8e74b53 100644
--- a/sysdeps/nptl/unwind-forcedunwind.c
+++ b/sysdeps/nptl/unwind-forcedunwind.c
@@ -49,7 +49,7 @@ pthread_cancel_init (void)
       return;
     }
 
-  handle = __libc_dlopen (LIBGCC_S_SO);
+  handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN);
 
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-10 20:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 10:49 [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel Florian Weimer
2018-01-10 11:10 ` Adhemerval Zanella
2018-01-10 19:09 ` Carlos O'Donell
2018-01-10 19:21   ` Florian Weimer
2018-01-10 19:29     ` Carlos O'Donell
2018-01-10 20:03       ` Florian Weimer
2018-01-10 20:21         ` Carlos O'Donell

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).