bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Bruno Haible <bruno@clisp.org>
Cc: libc-alpha@sourceware.org, bug-gnulib@gnu.org, binutils@sourceware.org
Subject: Re: Undefined use of weak symbols in gnulib
Date: Fri, 30 Apr 2021 11:55:36 +0200	[thread overview]
Message-ID: <87sg3885bb.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <1745276.bs2KPpY2O9@omega> (Bruno Haible's message of "Thu, 29 Apr 2021 17:15:23 +0200")

* Bruno Haible:

>> I spent today on coming up with a workaround in glibc.
>
> These are the workarounds I can see:
>   - Delay the planned changes in glibc by 5 years or so, to minimize
>     the number of binaries out there that would crash. (Probably not what
>     you want.)

Nah, those binaries won't go away in just five years.

>   - Change glibc's ld.so to deal with the binaries that are out there
>     and that have been produced by existing binutils (with or without the
>     patches that H.J. Lu listed).

This is what I've tried to implement:

  [RFC] elf: Implement filtering of symbols historically defined in libpthread
  <https://sourceware.org/pipermail/libc-alpha/2021-April/125564.html>

>   - Play tricks with the preprocessor, such as
>     '#define pthread_create pthread_create_in_libc'. (Probably not POSIX
>     compliant.)

It doesn't solve the problem, even for new binaries.

>   - Make use of symbol versioning. Symbol versioning was invented to
>     allow making big changes to libc without breaking binary backward
>     compatibility. (I don't know about the interplay between weak and
>     versioned symbols.)

If the symbol is weak and undefined at build time, there is no symbol
version attached to it.  My patch uses that to make sure the filtering
does not happen on the fast path (because symbols bound to libc.so.6
usually have versions), but I don't think symbol versioning is all that
useful in this context.

Thanks,
Florian



  reply	other threads:[~2021-04-30  9:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27  5:53 Undefined use of weak symbols in gnulib Florian Weimer
2021-04-27  6:50 ` Paul Eggert
2021-04-27  6:58   ` Florian Weimer
2021-04-27  7:13     ` Paul Eggert
2021-04-27  7:24 ` Andreas Schwab
2021-04-27 11:06   ` Florian Weimer
2021-04-28  0:09     ` Bruno Haible
2021-04-28  2:10       ` H.J. Lu
2021-04-28  2:13         ` H.J. Lu
2021-05-05 20:31           ` Fangrui Song
2021-04-28  8:35         ` Florian Weimer
2021-04-28 13:15           ` Michael Matz
2021-04-28  7:44       ` Florian Weimer
2021-04-28 14:48         ` Bruno Haible
2021-04-28 17:44           ` Florian Weimer
2021-07-17 14:38         ` Bruno Haible
2021-07-17 14:55           ` Florian Weimer
2021-07-17 16:39             ` Bruno Haible
2021-07-27 20:02           ` Joseph Myers
2021-07-27 20:19             ` Florian Weimer
2021-07-27 23:38               ` Paul Eggert
2021-07-17 16:21         ` Bruno Haible
2021-04-27 23:22   ` Bruno Haible
2021-04-27 23:47 ` Bruno Haible
2021-04-28  7:57   ` Florian Weimer
2021-04-28 14:40     ` Bruno Haible
2021-04-28 17:43       ` Florian Weimer
2021-04-29 15:15         ` Bruno Haible
2021-04-30  9:55           ` Florian Weimer [this message]
2021-04-29  6:33       ` Ben Pfaff
2021-05-03  1:44 ` Alan Modra
2021-07-12 10:04 ` Michael Hudson-Doyle
2021-07-12 15:03   ` Florian Weimer
2021-07-12 15:30     ` Matthias Klose
2021-07-12 15:37       ` Florian Weimer
2021-07-13  0:22         ` Michael Hudson-Doyle

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://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=87sg3885bb.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --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).