From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F316C385783D for ; Sun, 25 Jul 2021 22:08:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F316C385783D Received: by mail-pj1-x1030.google.com with SMTP id q17-20020a17090a2e11b02901757deaf2c8so11646867pjd.0 for ; Sun, 25 Jul 2021 15:08:23 -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=FX/pTJl9rwpIBwlS3Z5aRbBmp+OZfcetpveCe4LU/9I=; b=RzwkiIQIxV2zGeD24p7vxhncPFYEBzQtWD3hd93ceVhBzWgVPQR9f6RIPdUJGVhGkf CNPYSxiWNfVJHT4iejXRKKBpq57qwkmG8K8qqH7r4dhFOEbsOzOLX15vn2WaT22G7ih+ WwZGjfg+9H5z/kdbYtaIBllKt33WEnqcOqc50f73+Q4F/RzkqN4xvNgDiYmI0cZtwi99 BRmRytDz5Qjmu8mBwjNcI99Ws8MsF8629Qxn0wFM7u1kfQ9LGZ3+Sjrz0dd+/ofAszbF cl3Hr6QHhOgwWgEtmIOICGC4Rs7SbG/ip/eDZSDMNxDCTVcD1YS+yjXMYU1BEYlRmx4D oCrw== X-Gm-Message-State: AOAM533wWP+FcVbn8Cypk3qz3Yc0fVK9XcjwFEhntPgZhAAOWt66vH+v kkTftxZdKYe91wK7waourH57WVNX5zuj0OcL9A0= X-Google-Smtp-Source: ABdhPJxQwsXvffm06TFhLInt8MlwKMweSuxEReWK95aLFYnFq5ul1m2pzQ81v7RDKA2Iw3ThMCJjMmLP96V6KHiw+mk= X-Received: by 2002:a05:6a00:178f:b029:32b:2092:c3f5 with SMTP id s15-20020a056a00178fb029032b2092c3f5mr14762433pfg.57.1627250903098; Sun, 25 Jul 2021 15:08:23 -0700 (PDT) MIME-Version: 1.0 References: <7dd68a51-0904-98f8-e4ce-3e4bdcb14dc4@redhat.com> <4b8bcc59-362a-21ac-b531-6be07d0c722a@redhat.com> <87fsw2oy8c.fsf@oldenburg.str.redhat.com> In-Reply-To: <87fsw2oy8c.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Sun, 25 Jul 2021 15:07:47 -0700 Message-ID: Subject: Re: glibc 2.34 - Hard ABI freeze effective immediately. To: Florian Weimer Cc: "H.J. Lu via Libc-alpha" , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.4 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: Sun, 25 Jul 2021 22:08:26 -0000 On Sun, Jul 25, 2021 at 2:55 PM Florian Weimer wrote: > > * H. J. Lu via Libc-alpha: > > > It was a mistake to export _r_debug from ld.so: > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=28130 > > > > I'd like to deprecate _r_debug in glibc 2.34 and replace it with: > > > > /* Return the address of that structure used by the dynamic linker. */ > > extern struct r_debug * __r_debug_location (void) __attribute_const__; > > #define _r_debug (*__r_debug_location ()) > > > > so that I can extend struct r_debug for libraries loaded with dlmopen: > > > > https://gitlab.com/x86-psABIs/Linux-ABI/-/issues/2 > > We need to keep it as a symbol because debuggers use it. _r_debug is only needed in the static executable. Debuggers should use DT_DEBUG for dynamic executables. > If GCC had a an attribute that says, no copy relocation please, we could > perhaps use that in . > > Maybe we can turn it into a compat symbol. But it's too late for such We can make it a compat symbol: 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__; 2. Hide _r_debug in ld.so by defining _r_debug with __r_debug_location: #define _r_debug (*__r_debug_location ()) The existing dynamic executables with _r_debug reference will get a copy of _r_debug which won't be updated by ld.so. But DT_DEBUG will work with debuggers. 3. The static executables linked against glibc 2.34 will get the _r_debug symbol from __r_debug_location definition in libc.a. > changes in glibc 2.34. > > The replacement could use a separate symbol version (GLIBC_DEBUG) with > different ABI stability rules, which would pave the way towards > backporting. There is no need for a special version symbol. I have a proposal to make it both forward and backward compatible. -- H.J.