From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9D32438582AC for ; Mon, 21 Nov 2022 16:05:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9D32438582AC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669046715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oGnv17Ut4NF5h/pyO9/L0B9GfmmadM2i1xMQkVr97aY=; b=MpWs8gHc+E9T8E/rjGomTv57dLry4bj+KpmcTIN1EovDAF6dgjqvHditIZQnl3S4HntRSM R6YIUvV15ZoGU+V/udrgOqmz82qaog/kkBFi+FQ6uNXsDTW9g02W6kB6AzkVsPlqDoQ7yX uO6RXQWT8uOUpQr5F3Fx2rQS6X4kj1Y= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-665-dUst2D5XPfOZkkxF10nAzQ-1; Mon, 21 Nov 2022 11:05:12 -0500 X-MC-Unique: dUst2D5XPfOZkkxF10nAzQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 914633C025AD; Mon, 21 Nov 2022 16:05:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EFF7492B06; Mon, 21 Nov 2022 16:05:10 +0000 (UTC) From: Florian Weimer To: "Wangbing(wangbing, RTOS/Poincare Lab) via Libc-alpha" Cc: "Wangbing(wangbing,RTOS/Poincare Lab)" , Nixiaoming , zhongjubin , "Yanhuijun (DOPRA SSP)" Subject: Re: Add testcese// [PATCH] dlsym: Add RTLD_PROBE for situation when dlsym only wants to probe a symbol but not use it References: <7cad26c73f5b4172bbcf570882bf9d3d@huawei.com> Date: Mon, 21 Nov 2022 17:05:06 +0100 In-Reply-To: <7cad26c73f5b4172bbcf570882bf9d3d@huawei.com> (Wangbing via Libc-alpha's message of "Mon, 21 Nov 2022 14:06:07 +0000") Message-ID: <87r0xwthsd.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: > The reason why not useing struct link_map * as an argument to dlsym is > that there may be more than one same-named symbol in different so > files(provided by different vendors or components) in one process, and > by -Wl,-z,now=EF=BC=8Conly the first symbol is needed, and we cannot be s= ure > which struct link_map* should be send to dlsym. You should be able to use the link map of the main program (which is available through the global _r_debug variable). Access to _r_debug is currently broken in case of copy relocations, but I have posted a series that should fix it again. Then we just need to document how to access _r_debug, and that the link maps found there can be used as arguments to dlsym. For the time being, you can still experiment by building everything with -fPIC, or an architecture without copy relocations. Thanks, Florian