public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	 "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>,
	 Binutils <binutils@sourceware.org>
Subject: Re: RFC: Add GNU_PROPERTY_1_GLIBC_2_NEEDED
Date: Fri, 29 Oct 2021 12:47:25 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2110291243240.2998@wotan.suse.de> (raw)
In-Reply-To: <CAMe9rOqzgfNrGOp2U21bKMkJQRSzBOu95BMUxBd2_=tj_V9bSQ@mail.gmail.com>

Hello,

On Thu, 28 Oct 2021, H.J. Lu via Binutils wrote:

> > >> This proposal may conflict in spirit with the glibc proposal to support
> > >> preloadable symbol version (so you can add _dl_find_eh_frame@GLIBC_2.35
> > >> to a glibc 2.28 installation, for example).  So far, symbol versions
> > >
> > > Why will adding a glibc version dependency change the preload
> > > behavior?
> >
> > Previously, we thought we could relax the version coverage check to
> > enable adding completely new symbol versions by preloading an
> > implementation.  With BIND_NOW, this is completely safe because missing
> > symbols are still detected.  But this turns unreliable once glibc
> > versions are tied to ELF implementation features.  Preloading an
> > implementation of _dl_find_eh_frame@GLIBC_2.35 (for example) will not
> > add dynamic linker features first implemented in glibc 2.35.
> 
> I am not sure if I am following your concerns.   We have an ELF feature,
> like DT_RELR, which is tied to a glibc version.  The binary with DT_RELR
> will crash with the older glibcs.  And you DON'T want such a binary with
> a dependency on the required glibc version.  Can you tell me why?

You never want to test for versions to imply absence or presence of 
features.  You want to test for the feature, or alternatively for an 
indication of said feature.  Such indication could be the existence of a 
fake symbol (which can have a symbol version, no less), some flag 
mechanism (where to-be-defined flags would mean features), or suchlike.  I 
find the idea of symbols the most intuitive one.  DT_RELR binaries could 
require (from their .dynsym), say '_dl_have_relr', and glibc supporting it 
would provide that feature.

Version checks always run into trouble vs. backports, and simply aren't 
the right tool.


Ciao,
Michael.

      parent reply	other threads:[~2021-10-29 12:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 14:53 H.J. Lu
2021-10-26 15:25 ` Florian Weimer
2021-10-26 15:51   ` H.J. Lu
2021-10-26 18:39     ` v2: " H.J. Lu
2021-10-28  6:55     ` Florian Weimer
2021-10-28 13:37       ` H.J. Lu
2021-10-28 14:08         ` Florian Weimer
2021-10-28 14:17           ` H.J. Lu
2021-10-28 14:20             ` H.J. Lu
2021-10-29 18:11               ` Florian Weimer
2021-10-29 12:47         ` Michael Matz [this message]

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=alpine.LSU.2.20.2110291243240.2998@wotan.suse.de \
    --to=matz@suse.de \
    --cc=binutils@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.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).