From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 08E041F8C6 for ; Tue, 27 Jul 2021 17:40:23 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 384803847830 for ; Tue, 27 Jul 2021 17:40:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 384803847830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627407621; bh=o0p0DWKuGhvuANh/lm/RETUQRAnA6rvSXV4xqngYH/g=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XTb1BIxIF9sRIPosK2qFGajSCvCQ1d3HlmnTWuCnCp6aebZ4wFb/TubEhBKwqKO2U Dq8L2xYQig3s5Dg48ZRsXqVo54YyUrxdbO/a60Jx0EeKmJdeT1rDjIM7VfA+zS9TzU W8Dp8qy3DFT4AbGyoLmiG1AbzqdSXvTuHqOdp43k= Received: from rcdn-iport-9.cisco.com (rcdn-iport-9.cisco.com [173.37.86.80]) by sourceware.org (Postfix) with ESMTPS id E417F3848409 for ; Tue, 27 Jul 2021 17:40:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E417F3848409 X-IronPort-AV: E=Sophos;i="5.84,274,1620691200"; d="scan'208";a="822189424" Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by rcdn-iport-9.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 27 Jul 2021 17:40:00 +0000 Received: from zorba ([10.24.23.60]) by rcdn-core-10.cisco.com (8.15.2/8.15.2) with ESMTPS id 16RHdwBY023187 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 Jul 2021 17:40:00 GMT Date: Tue, 27 Jul 2021 10:39:58 -0700 To: "H.J. Lu" Subject: Re: [RFC PATCH 3/3] add r_debug multiple namespaces support Message-ID: <20210727173958.GB1633923@zorba> References: <20200626193228.1953-4-danielwa@cisco.com> <87ftah5yh8.fsf@oldenburg2.str.redhat.com> <210c992f-b034-3ef7-440c-f67ab1b3acdb@redhat.com> <87366h5xmi.fsf@oldenburg2.str.redhat.com> <7e2fb426-cf03-a8e7-6524-a5f81fcf5b9e@redhat.com> <87ftagyhra.fsf@mid.deneb.enyo.de> <8a15bd93-e4cc-a3bc-f902-5b3e701ec4e3@redhat.com> <87y2o61chx.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.23.60, [10.24.23.60] X-Outbound-Node: rcdn-core-10.cisco.com 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: , From: Daniel Walker via Libc-alpha Reply-To: Daniel Walker Cc: Florian Weimer , Carlos O'Donell via Libc-alpha , Pedro Alves , Conan C Huang , "Metzger, Markus T" , Florian Weimer , Jeremy Stenglein , xe-linux-external@cisco.com Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Fri, Jul 23, 2021 at 04:38:33PM -0700, H.J. Lu wrote: > On Mon, Jun 29, 2020 at 2:49 AM Florian Weimer via Libc-alpha > wrote: > > > > * Carlos O'Donell via Libc-alpha: > > > > >>> I'm not sure it would work to version _r_debug, since the debugger > > >>> is using DT_DEBUG and we only get to put one value in that > > >>> .dynamic entry. > > >> > > >> The symbol version is needed to avoid problems due to copy relocations > > >> if the symbol is referenced directly from the main program. Without > > >> that, the object could be truncated. It's not a debugger > > >> compatibility feature. > > > > > > Correct, but this violates *how* you're supposed to use _r_debug. > > > > If it is possible to link against it, we need to add the new symbol > > version, in my opinion. > > > > > In the dynamic case it is different. The symbol should be looked up > > > via DT_DEBUG only which always points to the library-local address > > > of the data object (and the most recent version). In effect this > > > bypasses the COPY relocation? > > > > How is this supposed to work if the dynamic linker does contain > > DT_DEBUG? > > > > I only observe DT_DEBUG in PIE binaries, but since the dynamic loader is > > mapped at a random address even for ET_EXEC main programs, there must be > > some other mechanism to locate it. > > > > Thanks, > > Florian > > > > I opened: > > https://gitlab.com/x86-psABIs/Linux-ABI/-/issues/2 > > with a proposal to extend struct r_debug for libraries loaded with > dlmopen, I'd like to resolve it for the next releases of glibc, binutils > and GDB. I have an updated set of changes which add a new dynamic entry DT_DEBUG_DLMOPEN, which was recommended by Carlos. We're still testing the implementation. I'm open to support different implementations. I found while working on this project that the clang linker adds 3 proprietary new dynamic entries. So there is demand to make adding to the table easier. Daniel