unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [RFC] elf: Implement filtering of symbols historically defined in libpthread
Date: Tue, 4 May 2021 04:47:38 -0700	[thread overview]
Message-ID: <CAMe9rOoO3yY3Z1jNU6rYr6uLrNrtUqaj2YbLAc6WFh78E8H1DA@mail.gmail.com> (raw)
In-Reply-To: <87h7jqguew.fsf@oldenburg.str.redhat.com>

On Wed, Apr 28, 2021 at 1:37 PM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> Definitions of these symbols in libc expose bugs in existing binaries
> linked against earlier glibc versions.  Therefore, hide these symbols
> for old binaries.
>
> The symbol list in sysdeps/nptl/dl-pthread-weak.c contains some
> symbols which have not been moved yet, but that is harmless because
> the function is only invoked if the symbol is found in libc.so.
>
> The test suite passes on i686-gnu-linux, powerpc64-linux-gnu,
> x86_64-linux-gnu with these changes.
>
> Is this the direction we want to go in?  Then I'm going to add test
> cases, probably using assembler.
>
> Personally I think it's not *too* bad, also not particularly nice
> either.  elf/dl-pthread-weak.os brings in 2-3 KiB of code (but few
> run-time relocations).  One possibility I have not mentioned in the
> comment is to put the moved symbols into a GLIBCPTHREAD_2.34 symbol
> version and use the presence of this version on the chain as an
> indicator that the symbol uses special treatment.  This eliminates the
> separate string table.  The downside is that we cannot easily add more
> symbols if we discover some are missing.  This happened to me during
> development with pthread_mutexattr_gettype, which is a GLIBC_2.1 symbol
> and therefore not actually suitable for detecting the presence of
> libpthread (historically speaking).  And it could happen again with
> thrd_exit (which is of course much younger).
>

Since we want to detect the binaries which were linked against glibc
older than 2.34, we should use the glibc version to check the old
binaries.  Of course, we should make a complete list of functions
which are really implemented in libpthread.so and will be moved to
libc.so in glibc 2.34.

H.J.

  parent reply	other threads:[~2021-05-04 11:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 18:01 [RFC] elf: Implement filtering of symbols historically defined in libpthread Florian Weimer via Libc-alpha
2021-05-04  6:55 ` Florian Weimer via Libc-alpha
2021-05-04 11:47 ` H.J. Lu via Libc-alpha [this message]
2021-05-04 12:04   ` Florian Weimer via Libc-alpha
2021-05-04 12:24     ` H.J. Lu via Libc-alpha
2021-05-04 12:27       ` Florian Weimer via Libc-alpha
2021-05-04 12:30         ` H.J. Lu via Libc-alpha
2021-05-04 12:33           ` Florian Weimer via Libc-alpha
2021-05-04 12:36             ` H.J. Lu via Libc-alpha
2021-05-04 12:43               ` Florian Weimer via Libc-alpha
2021-05-04 13:06                 ` H.J. Lu via Libc-alpha
2021-05-04 13:13                   ` Florian Weimer via Libc-alpha
2021-05-04 13:28                     ` H.J. Lu via Libc-alpha
2021-05-04 12:59 ` Adhemerval Zanella via Libc-alpha
2021-05-04 21:08   ` Carlos O'Donell via Libc-alpha
2021-05-04 13:08 ` Andreas Schwab
2021-05-04 16:52   ` Florian Weimer via Libc-alpha
2021-05-04 21:28 ` Carlos O'Donell via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=CAMe9rOoO3yY3Z1jNU6rYr6uLrNrtUqaj2YbLAc6WFh78E8H1DA@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=schwab@linux-m68k.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).