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: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 GNU C Library <libc-alpha@sourceware.org>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH v2] elf: Implement filtering of symbols historically defined in libpthread
Date: Wed, 5 May 2021 12:32:48 -0700	[thread overview]
Message-ID: <CAMe9rOrJxQYmXgOO9+Jby3ZEpurG2AnYamN-XEotyvh6R7spbw@mail.gmail.com> (raw)
In-Reply-To: <87bl9pati7.fsf@oldenburg.str.redhat.com>

On Wed, May 5, 2021 at 12:08 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > On Wed, May 5, 2021 at 11:48 AM Florian Weimer <fweimer@redhat.com> wrote:
> >>
> >> * H. J. Lu:
> >>
> >> > On Wed, May 5, 2021 at 11:28 AM Florian Weimer <fweimer@redhat.com> wrote:
> >> >>
> >> >> * H. J. Lu:
> >> >>
> >> >> > Why can't we just hide symbols for undefined, weak, unversioned references
> >> >> > from the old binaries?
> >> >>
> >> >> You mean, in general, no matter if the symbol was previously in
> >> >> libpthread or not?
> >> >>
> >> >> Some such symbols had definitions in libc before and where bound.
> >> >
> >> > If they were defined in libc.so to begin with, why are they unversioned?
> >>
> >> I assume some people use stub libraries for linking.
> >
> > Do we really support these binaries?  The symbol versions will be wrong
> > on them.
>
> Well, I guess I have a definitive answer now.  I keep some old binaries
> and their sources around here (along with wrapper scripts to run them on
> current systems, although I haven't checked lately if they still work):
>
>   <https://pagure.io/glibc/glibc-test-binaries/>
>
> gcc-2.7.2.3/i386/root/usr/lib/gcc-lib/i486-linux/2.7.2.3/cc1plus
> contains this in its dynamic symbol table:
>
>    16: 08048c9c    129 FUNC    GLOBAL DEFAULT    UNDEF memcpy
>    17: 08048e8c     62 FUNC    GLOBAL DEFAULT    UNDEF strcmp
>    18: 08048ccc    304 FUNC    WEAK   DEFAULT    UNDEF malloc
>    19: 08048f5c    195 FUNC    WEAK   DEFAULT    UNDEF free
>    20: 08048c7c    136 FUNC    GLOBAL DEFAULT    UNDEF getenv
>    21: 08048dec    565 FUNC    WEAK   DEFAULT    UNDEF realloc
>    22: 08048e4c    124 FUNC    WEAK   DEFAULT    UNDEF fopen
>    23: 08048e7c    192 FUNC    WEAK   DEFAULT    UNDEF fclose
>    24: 08048c8c    186 FUNC    GLOBAL DEFAULT    UNDEF qsort
>    25: 08048d1c     50 FUNC    GLOBAL DEFAULT    UNDEF __sigsetjmp
>    26: 08048c2c     80 FUNC    GLOBAL DEFAULT    UNDEF longjmp
>    27: 08048dac    226 FUNC    WEAK   DEFAULT    UNDEF signal
>    28: 08048cfc     88 FUNC    GLOBAL DEFAULT    UNDEF bzero
>    29: 08048e5c    104 FUNC    GLOBAL DEFAULT    UNDEF memset
>    30: 08048f1c     38 FUNC    GLOBAL DEFAULT    UNDEF atoi
>    31: 08048dbc    159 FUNC    GLOBAL DEFAULT    UNDEF strncmp
>    32: 08048cbc    641 FUNC    WEAK   DEFAULT    UNDEF system
>    33: 08048e9c   1460 FUNC    WEAK   DEFAULT    UNDEF getcwd
>    34: 08048d7c    426 FUNC    GLOBAL DEFAULT    UNDEF strcat
>    35: 08048c3c     39 FUNC    GLOBAL DEFAULT    UNDEF strcpy

This binary was linked against the old glibc which doesn't have
symbol version.  This binary may have other issues with today's glibc.

> I assume an old version of ld copied the weak symbol status from the
> definition in a shared object to the program.  We obviously cannot hide
> these weak symbol references.  So my hunch was right that we have to
> make visibility decisions on a per-symbol basis.
>
> Thanks,
> Florian
>


-- 
H.J.

  reply	other threads:[~2021-05-05 19:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 13:44 Florian Weimer
2021-05-05 14:10 ` Adhemerval Zanella
2021-05-05 15:30   ` Florian Weimer
2021-05-05 15:53   ` H.J. Lu
2021-05-05 16:01     ` Florian Weimer
2021-05-05 16:55       ` Adhemerval Zanella
2021-05-05 17:19         ` Florian Weimer
2021-05-05 17:52           ` H.J. Lu
2021-05-05 17:56             ` Florian Weimer
2021-05-05 18:06           ` Adhemerval Zanella
2021-05-05 18:16             ` Florian Weimer
2021-05-05 18:18               ` H.J. Lu
2021-05-05 18:28                 ` Florian Weimer
2021-05-05 18:30                   ` H.J. Lu
2021-05-05 18:48                     ` Florian Weimer
2021-05-05 18:50                       ` H.J. Lu
2021-05-05 19:08                         ` Florian Weimer
2021-05-05 19:32                           ` H.J. Lu [this message]
2021-05-05 19:53                             ` Florian Weimer
2021-05-05 19:03 ` Andreas Schwab
2021-05-05 19:10   ` Florian Weimer
2021-05-05 20:48     ` H.J. Lu
2021-05-05 20:53       ` H.J. Lu
2021-05-06  9:17         ` Florian Weimer
2021-05-06 12:08           ` H.J. Lu
2021-05-06 12:50             ` Florian Weimer
2021-05-06 12:58               ` Adhemerval Zanella
2021-05-06 13:15               ` H.J. Lu
2021-05-07 14:46 ` Florian Weimer
2021-05-07 16:40   ` H.J. Lu
2021-05-10 13:48     ` Florian Weimer
2021-05-10 14:02       ` H.J. Lu
2021-05-10 14:08         ` Florian Weimer
2021-05-11  0:04           ` 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=CAMe9rOrJxQYmXgOO9+Jby3ZEpurG2AnYamN-XEotyvh6R7spbw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --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).