From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 17178382E2B0 for ; Fri, 20 May 2022 14:22:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17178382E2B0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=38253 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1ns3WG-00HJLS-OO; Fri, 20 May 2022 14:22:20 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1ns3WG-0001yx-E4; Fri, 20 May 2022 16:22:20 +0200 From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH] dlsym: Make RTLD_NEXT prefer default version definition [#BZ #14932] References: <20220520083507.2368165-1-maskray@google.com> Date: Fri, 20 May 2022 16:22:20 +0200 In-Reply-To: (Adhemerval Zanella via Libc-alpha's message of "Fri, 20 May 2022 08:27:53 -0300") Message-ID: <87y1yw2sir.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 14:22:24 -0000 * Adhemerval Zanella via Libc-alpha: > On 20/05/2022 05:35, Fangrui Song via Libc-alpha wrote: >> When the first object providing foo defines both foo@v1 and foo@@v2, >> dlsym(RTLD_NEXT, "foo") returns foo@v1 while dlsym(RTLD_DEFAULT, "foo") >> returns foo@@v2. The issue is that RTLD_DEFAULT use the >> DL_LOOKUP_RETURN_NEWEST flag while RTLD_NEXT doesn't. Fix the RTLD_NEXT >> branch to use DL_LOOKUP_RETURN_NEWEST. > > I am afraid we will need to add a compat dlsym for this change. My working theory is dlsym with RTLD_NEXT with a versioned symbol is so buggy that this is not needed. I want to understand the nature of the bug, and plan to post a write-up.