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 <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer 2018-01-10 13:18:04 +01:00
parent 09085ede12
commit f993b87540
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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.
2018-01-10 Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd/hurd/fd.h: Include <fcntl.h>

View File

@ -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