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 6F9673858C62 for ; Tue, 27 Sep 2022 10:40:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F9673858C62 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=50749 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 1od80t-007uLJ-AO; Tue, 27 Sep 2022 10:40:31 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1od80t-000AYz-0J; Tue, 27 Sep 2022 12:40:31 +0200 From: Florian Weimer To: "Wangbing(wangbing, RTOS/Poincare Lab) via Libc-alpha" Cc: "Wangbing(wangbing,RTOS/Poincare Lab)" , Nixiaoming Subject: Re: [PATCH] dlsym: Add RTLD_PROBE for situation when dlsym only wants to probe a symbol but not use it References: Date: Tue, 27 Sep 2022 12:40:31 +0200 In-Reply-To: (Wangbing via Libc-alpha's message of "Tue, 27 Sep 2022 09:21:04 +0000") Message-ID: <87mtalxfq8.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Wangbing via Libc-alpha: > dlsym with RTLD_DEFAULT add dependency for target symbol, if program > use dlsym only to detect if a symbol exist, and will not use it. > > this operation will make unable to dlclose so file containing target > symbol, add RTLD_PROBE to support symbol probe. I'd appreciate if you could write a test case for this functionality. I'm not sure if the new functionality is needed. If we document that a struct link_map * obtained from _dl_find_object or via _r_debug.r_map can be used as an argument to dlsym (and other places where a DSO handle is currently accepted), programmers could use that to get this effect. I believe this works today (as an undocumented feature) and does not record the dependency.