This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 10 Jan 2018 11:09:25 -0800
- Subject: Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel
- Authentication-results: sourceware.org; auth=none
- References: <20180110104903.A4F88439942E1@oldenburg.str.redhat.com>
On 01/10/2018 02:49 AM, Florian Weimer wrote:
> 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
>
Should we not also do this for sysdeps/gnu/unwind-resume.c ?
--
Cheers,
Carlos.