unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.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, 04 May 2021 14:04:43 +0200	[thread overview]
Message-ID: <87k0oeln6s.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOoO3yY3Z1jNU6rYr6uLrNrtUqaj2YbLAc6WFh78E8H1DA@mail.gmail.com> (H. J. Lu's message of "Tue, 4 May 2021 04:47:38 -0700")

* H. J. Lu:

> 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.

The patch attempts to detect old main programs by looking for the
GLIBC_2.34 symbol version.  Since we added __libc_start_main@GLIBC_2.34
(which is called from our version of _start), all standard main programs
linked with glibc 2.34 or later will have this symbol version.

> 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.

I'm not sure if it is necessary to do this for *all* symbols.  Formally,
a symbol added after glibc 2.0 is not suitable for detecting the
potential multi-threaded nature of a process because the application
could be built for an earlier glibc version, where the symbol is not
available, but pthread_create can still create new threads.  The use of
pthread_mutexattr_gettype@@GLIBC_2.1 as the detection symbol does not
follow the rule, of course.  With the explicit table approach (as in the
patch), we can add additional lookup symbols later, so I think we can
start out with the GLIBC_2.0 and GLIBC_2.1 symbols plus thrd_exit (the
latter is also used by gnulib for some reason).

Thanks,
Florian


  reply	other threads:[~2021-05-04 12:04 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
2021-05-04 12:04   ` Florian Weimer via Libc-alpha [this message]
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=87k0oeln6s.fsf@oldenburg.str.redhat.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).