From: Florian Weimer Date: Wed, 10 Jan 2018 12:18:04 +0000 (+0100) Subject: nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636] X-Git-Tag: glibc-2.27~151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f993b8754080ac7572b692870e926d8b493db16c;p=thirdparty%2Fglibc.git nptl: Open libgcc.so with RTLD_NOW during pthread_cancel [BZ #22636] 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. Reviewed-by: Adhemerval Zanella --- diff --git a/ChangeLog b/ChangeLog index b1da834f8e0..10658831cc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-01-10 Florian Weimer + + [BZ #22636] + * sysdeps/nptl/unwind-forcedunwind.c (pthread_cancel_init): Open + libgcc.so with RTLD_NOW, to avoid lazy binding during unwind. + 2018-01-10 Samuel Thibault * hurd/hurd/fd.h: Include diff --git a/sysdeps/nptl/unwind-forcedunwind.c b/sysdeps/nptl/unwind-forcedunwind.c index ab4350de99f..67b8e74b536 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