From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19639 invoked by alias); 10 Jan 2018 20:03:27 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 19625 invoked by uid 89); 10 Jan 2018 20:03:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Subject: Re: [PATCH] nptl: Open libgcc.so with RTLD_NOW during pthread_cancel To: Carlos O'Donell , libc-alpha@sourceware.org References: <20180110104903.A4F88439942E1@oldenburg.str.redhat.com> <0e8290f2-4c7f-2d1e-1bdd-09f6d4770947@redhat.com> From: Florian Weimer Message-ID: <27824c97-0aa6-4dd3-9efb-832a678b2ebd@redhat.com> Date: Wed, 10 Jan 2018 20:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <0e8290f2-4c7f-2d1e-1bdd-09f6d4770947@redhat.com> Content-Type: multipart/mixed; boundary="------------4D5688E4DE60BAD795672568" X-SW-Source: 2018-01/txt/msg00342.txt.bz2 This is a multi-part message in MIME format. --------------4D5688E4DE60BAD795672568 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 293 On 01/10/2018 08:29 PM, Carlos O'Donell wrote: > What I want to avoid is two similar pieces of code that do distinct > things. Is there any reason we shouldn't just checkin a change here > that makes both the same, thus avoiding differences? Okay, then let's add a comment. Thanks, Florian --------------4D5688E4DE60BAD795672568 Content-Type: text/x-patch; name="unwind.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="unwind.patch" Content-length: 1226 Subject: [PATCH] csu: Update __libgcc_s_init comment To: libc-alpha@sourceware.org 2018-01-10 Florian Weimer * sysdeps/gnu/unwind-resume.c (__libgcc_s_init): Update comment and error message. diff --git a/sysdeps/gnu/unwind-resume.c b/sysdeps/gnu/unwind-resume.c index 94704c9a2b..7f9a1bf2c7 100644 --- a/sysdeps/gnu/unwind-resume.c +++ b/sysdeps/gnu/unwind-resume.c @@ -35,13 +35,17 @@ __libgcc_s_init (void) void *resume, *personality; void *handle; - handle = __libc_dlopen (LIBGCC_S_SO); + /* Use RTLD_NOW here for consistency with pthread_cancel_init. + RTLD_NOW will rarely make a difference here because unwinding is + already in progress, so libgcc_s.so has already been loaded if + its unwinder is used. */ + handle = __libc_dlopen_mode (LIBGCC_S_SO, RTLD_NOW | __RTLD_DLOPEN); if (handle == NULL || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL) __libc_fatal (LIBGCC_S_SO - " must be installed for pthread_cancel to work\n"); + " must be installed for unwinding to work\n"); #ifdef PTR_MANGLE PTR_MANGLE (resume); --------------4D5688E4DE60BAD795672568--