From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CDSrDg2mfmiPEjkAWB0awg (envelope-from ) for ; Mon, 21 Jul 2025 16:41:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1753130509; bh=7g2+bJq1ntq4gbxYSQMvNsXRTC3ElMD83gTOlgPStCo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jAW/Pt4HUUNHTQxKEq/MGE1GUGg+s7oQEm9i9JZapYkeo19YeFu7OOiOOK2GBw1wV XspIsBm1b47A/7MF3jL935Kj25rD/9KaTwrRRHzdAabhY2+hHGFaEHrlu6st+oN+kU 7q+hUy7dXnCH+IqcAjBnzhqi2j6El5ZOSrxpKBm8= Received: by simark.ca (Postfix, from userid 112) id 377951E11C; Mon, 21 Jul 2025 16:41:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=unavailable autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=mRwc2BqH; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=kCTPWXos; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AB78F1E089 for ; Mon, 21 Jul 2025 16:41:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35624385B538 for ; Mon, 21 Jul 2025 20:41:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35624385B538 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=mRwc2BqH; dkim=pass (1024-bit key) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=kCTPWXos Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E73733857BAF for ; Mon, 21 Jul 2025 20:41:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E73733857BAF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E73733857BAF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1753130479; cv=none; b=xX3RtexrkTY9L8SHT/dAWUk7w599lSBFvy3mF6ajgCH8SdT1KNOckkeWv+xmBmQxn6Fi4nhe0PXVvwJiSuLqHDzowFciJX7SpnQ5HvM9Z6SAmN14JK82Fxpwmi6QJKbqmASSnx352ELslIDFs9b8Ir1mii+6y3npCDLQfPVwuB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1753130479; c=relaxed/simple; bh=7g2+bJq1ntq4gbxYSQMvNsXRTC3ElMD83gTOlgPStCo=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=JMBdKXwwqOSJ7cMwK7+96ygX2k9u1EQgV6mdU0gzJK6C9klhkR/oHq/XIaLtC1vOVdbgsE8uK0ZpbGWThJNf51Rd+fjZI3ddqBTm3kiNhedg9Hs2F3rWI8rlz5EhdD5WYLhNMNf40obNdW06yTC2Lv2ka0oJewa4u6z5+hFeBs8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E73733857BAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1753130478; bh=7g2+bJq1ntq4gbxYSQMvNsXRTC3ElMD83gTOlgPStCo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mRwc2BqHExPp6nv9cRRE9lnTeMp5rA7299Ap1IYr7zYx+4C1RcX1W+LFI6YXjB/ja C3auXmocH6bIpibN9Q8CRmkCJBqF0KKjn0jWE/O95LvJxhVmjK52R7cSCC32aQRDEA IgRAdFjC/FBVZYY/rhicouPE8zAfVduT6FzeMdY0= Received: by simark.ca (Postfix, from userid 112) id 9A3E81E11E; Mon, 21 Jul 2025 16:41:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1753130477; bh=7g2+bJq1ntq4gbxYSQMvNsXRTC3ElMD83gTOlgPStCo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kCTPWXosPNPTpDFPYZYIvdapDnDc4ESOkTpfzp8cVxM/zA2yDAYdmSbRMvd2Q+PM+ lfGT8t85Ev+KFg4pPcwxWWywV5AgMwbT9iLy4Wz6osAg0ixq67ulU2jEC/L8Tjp1bw cPAiT5v/z6gY58szGULo/K0ltM39zHbjheRJUopA= Received: from [172.16.0.192] (192-222-132-26.qc.cable.ebox.net [192.222.132.26]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DA6131E089; Mon, 21 Jul 2025 16:41:16 -0400 (EDT) Message-ID: <2f5a89a5-95e0-44bb-aa47-755451dc0192@simark.ca> Date: Mon, 21 Jul 2025 16:41:16 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 03/15] gdb, gdbserver: support dlmopen() To: Markus Metzger , gdb-patches@sourceware.org Cc: Lu@sourceware.org, Hongjiu References: <20220602132514.957983-1-markus.t.metzger@intel.com> <20220602132514.957983-4-markus.t.metzger@intel.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20220602132514.957983-4-markus.t.metzger@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 6/2/22 9:25 AM, Markus Metzger via Gdb-patches wrote: > @@ -359,14 +370,35 @@ struct svr4_info > probe_and_action->prob->address. */ > htab_up probes_table; > > - /* List of objects loaded into the inferior, used by the probes- > - based interface. */ > - struct so_list *solib_list = nullptr; > + /* List of objects loaded into the inferior per namespace, used by the > + probes-based interface. > + > + The namespace is represented by the address of its corresponding > + r_debug[_ext] object. We get the namespace id as agrument to the > + 'reloc_complete' probe but we don't get it when scanning the load map > + on attach. > + > + The r_debug[_ext] objects may move when ld.so itself moves. In that > + case, we expect also the global _r_debug to move so we can detect > + this and reload everything. The r_debug[_ext] objects are not > + expected to move individually. > + > + The special entry zero is reserved for a linear list to support > + gdbstubs that do not support namespaces. */ > + std::map solib_lists; Hi Markus (and others), I'm currently doing some work inside solib-svr4.c, and I am puzzled by the comments that say that _r_debug and ld.so can move. I noticed that when starting the inferior, we try to read the shared library list very early, before the dynamic linker had time to set the DT_NEEDED slots. So at this point, we read read a debug base of 0. And so we need to handle it changing from 0 to the value it will eventually have. But are there really use cases of ld.so relocating mid-execution? I would have hoped that when we have a value for the default debug base, we can assume that it won't change. The only thing related to the debug base changing I found is this: https://pi.simark.ca/gdb-patches/20080221014732.GA27568@caradoc.them.org/T/#rc0d0f322c8b484ecb620ec3d0d6263190e323182 But I wonder if it is still relevant today... Thanks, Simon