public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>,
	"Carlos O'Donell" <carlos@redhat.com>
Subject: Re: glibc 2.34 - Hard ABI freeze effective immediately.
Date: Sun, 25 Jul 2021 15:07:47 -0700	[thread overview]
Message-ID: <CAMe9rOpTPv8aJTGbBV0FSEgz8xhKXMerbEk9c+9vkh52cfpV1w@mail.gmail.com> (raw)
In-Reply-To: <87fsw2oy8c.fsf@oldenburg.str.redhat.com>

On Sun, Jul 25, 2021 at 2:55 PM Florian Weimer <fweimer@redhat.com> 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 <link.h>.
>
> 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.

  reply	other threads:[~2021-07-25 22:08 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05  2:43 glibc 2.34 - Slushy " Carlos O'Donell
2021-07-19  2:15 ` glibc 2.34 - Hard ABI " Carlos O'Donell
2021-07-19 13:51   ` Florian Weimer
2021-07-19 14:13     ` Adhemerval Zanella
2021-07-19 14:30       ` Florian Weimer
2021-07-22 12:28         ` Carlos O'Donell
2021-07-22 13:02           ` Carlos O'Donell
2021-07-22 17:56             ` Florian Weimer
2021-07-22 12:31   ` Carlos O'Donell
2021-07-22 13:24     ` Adhemerval Zanella
2021-07-23  5:13       ` Carlos O'Donell
2021-07-23  5:53         ` Siddhesh Poyarekar
2021-07-26 14:22           ` Carlos O'Donell
2021-07-26 14:28             ` Samuel Thibault
2021-07-26 14:37               ` Siddhesh Poyarekar
2021-07-26 14:45                 ` Samuel Thibault
2021-07-23 13:13         ` Adhemerval Zanella
2021-07-26 13:00           ` Carlos O'Donell
2021-07-26 13:13             ` Adhemerval Zanella
2021-07-26 18:31             ` Adhemerval Zanella
2021-07-22 13:51     ` Siddhesh Poyarekar
2021-07-25 19:46   ` H.J. Lu
2021-07-25 21:54     ` Florian Weimer
2021-07-25 22:07       ` H.J. Lu [this message]
2021-07-25 22:14         ` Florian Weimer
2021-07-26  7:19         ` Andreas Schwab
2021-07-26 14:29     ` Carlos O'Donell
2021-07-26 14:32       ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOpTPv8aJTGbBV0FSEgz8xhKXMerbEk9c+9vkh52cfpV1w@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).