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.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,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 123981F8C6 for ; Wed, 28 Jul 2021 15:16:10 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E630339960F4 for ; Wed, 28 Jul 2021 15:16:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E630339960F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627485367; bh=a2hlyEoqHPvyhaY7DO/LoEdVI5jXF77MGEEo/s5yBAk=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=aiB9hcfeHu732xcKLv4J0goaktM5nfcewg0S+13lZaAeKcWnLjoH4e3Ggt83Xkbct mX7xHLkc3ZRgKyuGIVsnAtuzsoydrGdm1hbOT0PdUfcF7GC2ytd2bUMsFET4WnXQa9 wJ6usLrpxb08GazVwcj4B1dGjMXn8u/RRUlsjqxI= Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 77F88384F027 for ; Wed, 28 Jul 2021 15:15:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77F88384F027 Received: by mail-pj1-x1030.google.com with SMTP id pf12-20020a17090b1d8cb0290175c085e7a5so10575054pjb.0 for ; Wed, 28 Jul 2021 08:15:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a2hlyEoqHPvyhaY7DO/LoEdVI5jXF77MGEEo/s5yBAk=; b=D03FXwzo9LmTeJ5ZXnS6l0IKy0/0Gd8IbrM7Umkx+Y036m4CIjqJ3kdR0dgf6Q4xz/ ehqtGjaqjloknnUVmB0srLXq48UCa0VR0lODz+GU8eJ96Qefcu9toPsrL220gDg2ti0d iBaHS6pgyZifzs3Eift4brd6bivUqh/coeNPcBWsgtQadZ7+6P2xwO/M9JMzmqpF3SKr /HFNLSwxN7BxcmhAZldZJF4FIF4m3T6nQDToBtxNMb/tT023kbKMjtj8xPNMrMgqB/fp rv1VTxtoKa9Mczpew+pNFftYUUD+WSSnsJhvD5DlxKggnPvK5CWw++ABhLuOAEsStO64 voWg== X-Gm-Message-State: AOAM531dLxvOgqJK8hLoiYFlnRIhlrHfCePQe4KnCAl0RiesVARgivO6 GIAG9X7s2dJSZD2/DivqXhjH5zxupcvQul8FT20= X-Google-Smtp-Source: ABdhPJxdneb1kOhi9dMC5xOY70k3bxMiePJ8V7gm/gXdlD+utaygBwHNAgWA1LszuWc/65KqPmcUwa5P0a7lfpumIpA= X-Received: by 2002:a05:6a00:178f:b029:32b:2092:c3f5 with SMTP id s15-20020a056a00178fb029032b2092c3f5mr259140pfg.57.1627485346557; Wed, 28 Jul 2021 08:15:46 -0700 (PDT) MIME-Version: 1.0 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> <20210727173958.GB1633923@zorba> In-Reply-To: Date: Wed, 28 Jul 2021 08:15:10 -0700 Message-ID: Subject: Re: [RFC PATCH 3/3] add r_debug multiple namespaces support To: Daniel Walker Content-Type: text/plain; charset="UTF-8" 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: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" 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 Tue, Jul 27, 2021 at 11:14 AM H.J. Lu wrote: > > On Tue, Jul 27, 2021 at 10:40 AM Daniel Walker wrote: > > > > 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. Please send an email to gABI group: https://groups.google.com/g/generic-abi to add a new DT_XXX. If it is impractical to add a new DT_XXX to gABI, I propose DT_GNU_DEBUG: https://gitlab.com/x86-psABIs/Linux-ABI/-/issues/2 to cover dlmopen and beyond. > Let's work on it after glibc 2.34 is branched. > > > 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 > > > > -- > H.J. -- H.J.