From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 853D93855028 for ; Mon, 2 Aug 2021 23:06:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 853D93855028 Received: by mail-pl1-x62a.google.com with SMTP id e5so21454281pld.6 for ; Mon, 02 Aug 2021 16:06:58 -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=AAjs682EfCJgHnV/QOn4/kKOWmrnX0FRyFmBpNPF++s=; b=d/G4Rb4tsxXLw6oUWDqjRWcH/HY3CeVTPeQ2K5ZbCA6saX2HWDrG5A8VvdnRdub/s7 kQPRmPcRIrV5/sGPoyUNKGmR5yRrYbG/AlwUwsgN6d3oa3kQ5+Wz/0pHVuXvBv2BmlHR BiuoFcuCiiPfp2NwQuPS8/d5WiI9WIY0Hb9iHJqrkCBtzJ5Zqm49oTZ9LlXvsReKfkEQ oizlqegONiC0lKuP76Ku0A4xxFO1GA7dOQiZGpbiZQlbaYg8HawuLIMo/lBSN+W62EyS L56yiEfbV0nEpvxP1Uil4EaW7Yd3Qu1nEptiwsqA7UDxezZZH6pH7+LsHDxF+0siu0Z0 dO9Q== X-Gm-Message-State: AOAM531TgmqCaGC8i9BERPhF0n1SmOKc1P1G8Rn+AHFqLQSRPHHyVjYj D3JhIPZWm4TYneauK80iKehNAona0R+QLqsJUIU= X-Google-Smtp-Source: ABdhPJz71Xx1MUcz8FDVL0YOuVAuEBrKMN0RsYb6+8pJVlJlS+Ujx8bx4xK6F+tWgxgN9D+74h98shigHlXOjViAk0Q= X-Received: by 2002:a17:90a:ab0f:: with SMTP id m15mr19773297pjq.154.1627945617605; Mon, 02 Aug 2021 16:06:57 -0700 (PDT) MIME-Version: 1.0 References: <20210802042940.932692-1-hjl.tools@gmail.com> <20210802042940.932692-2-hjl.tools@gmail.com> <87h7g8ug94.fsf@igel.home> <87o8afk0ie.fsf@oldenburg.str.redhat.com> In-Reply-To: From: "H.J. Lu" Date: Mon, 2 Aug 2021 16:06:21 -0700 Message-ID: Subject: Re: [PATCH 2/2] ld.so: Hide _r_debug to support DT_DEBUG [BZ #28130] To: Florian Weimer Cc: Andreas Schwab , "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 02 Aug 2021 23:06:59 -0000 On Mon, Aug 2, 2021 at 2:46 PM H.J. Lu wrote: > > On Mon, Aug 2, 2021 at 2:20 PM Florian Weimer via Libc-alpha > wrote: > > > > * Andreas Schwab: > > > > > On Aug 01 2021, H.J. Lu via Libc-alpha wrote: > > > > > >> 1. Add a function, __r_debug_location, which returns the address of > > >> _r_debug: > > >> > > >> /* Return the address of that structure used by the dynamic linker. */ > > >> extern struct r_debug * __r_debug_location (void) __attribute_const__; > > >> > > >> It has a special glibc version, GLIBC_DEBUG. > > >> > > >> 2. Hide _r_debug in ld.so by defining _r_debug with __r_debug_location: > > >> > > >> #define _r_debug (*__r_debug_location ()) > > > > > > There is no need for that. Nobody should be using _r_debug. > > > > It's declared in a public header. GNAT and Spindle use it. Maybe this > > It is wrong to use it to begin with. We need to support usages of _r_debug for some applications. extern struct r_debug * __r_debug_location (void) __attribute_const__; #define _r_debug (*__r_debug_location ()) works here. > > needs to be deprecated first before it can be removed. > > My v2 patch includes an alternative in libsupport. > > -- > H.J. -- H.J.