public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "Fāng-ruì Sòng" <maskray@google.com>,
	llvm-dev@lists.llvm.org, "GCC Development" <gcc@gcc.gnu.org>,
	"GNU C Library" <libc-alpha@sourceware.org>,
	"GNU gABI gnu-gabi" <gnu-gabi@sourceware.org>,
	Binutils <binutils@sourceware.org>
Subject: Re: [llvm-dev] RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX
Date: Tue, 22 Jun 2021 14:54:47 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.22.394.2106221436590.6035@wotan.suse.de> (raw)
In-Reply-To: <CAMe9rOr-+Hb4jCf4DdxWLX3fEPFShbYtUhuJUmjqVvVhBJP1-g@mail.gmail.com>

Hello,

On Tue, 22 Jun 2021, H.J. Lu wrote:

> > > The issue is that libfoo.so used in link-time can be different from
> > > libfoo.so at run-time.  The symbol, foobar, in libfoo.so at link-time
> > > has the default visibility.  But foobar in libfoo.so at run-time can be
> > > protected.  ld.so should detect such cases which can lead to run-time
> > > failures.
> >
> > Yes, but I think we can _unconditionally_ give an error in this case, even
> > without a marker.  I view restricting visiblity of a symbol in furture
> 
> Unconditionally issuing an error can be an option, but mandatory.
> Otherwise working binary today will fail to run tomorrow.

Like a binary that's working today will fail tomorrow if the updated 
shared lib simply removes a symbol from it's export without proper 
versioning.  I don't see a material difference.

> > versions of shared libraries to be an ABI change, hence it has to be
> > something that either requires a soname bump or at the very least symbol
> 
> To support existing binaries, we need a soname bump.
> 
> > versioning with the old version staying on default visibility.
> 
> Symbol versioning doesn't work here since both symbols are at
> the same address.

I don't see why the address should matter.  My point was that in the end 
the exported symbol table for such shared lib (where foobar was changed 
from default to protected visiblity) should have

 1: 12345 42 FUNC GLOBAL DEFAULT 1 foobar@Old
 2: 12345 42 FUNC GLOBAL PROTECTED 1 foobar@@New

This might require new GAS directives and compiler attributes (or might be 
expressible already).  References from within the shared library would 
need to continue going via the default visiblity symbol, so that it 
supports old binaries containing copy relocs, which just again points out 
that it's a bad idea to restrict visibility after the fact.

AFAICS your scheme also doesn't support old binaries with newly protected 
symbols in newer shared libs, so an (unconditional) error in such 
situation seems appropriate.  IOW: which scenario do you want to not error 
on when you want to make the error conditional?


Ciao,
Michael.

  reply	other threads:[~2021-06-22 14:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 17:06 H.J. Lu
2021-01-21 15:02 ` H.J. Lu
2021-01-21 21:42   ` Fangrui Song
2021-04-17 12:48     ` H.J. Lu
2021-04-17 18:25       ` Fangrui Song
2021-04-17 19:05         ` H.J. Lu
2021-06-17 18:59   ` H.J. Lu
2021-06-17 19:38     ` [llvm-dev] " Fangrui Song
2021-06-17 19:45       ` H.J. Lu
2021-06-17 20:25         ` Fāng-ruì Sòng
2021-06-17 23:01           ` H.J. Lu
2021-06-18  0:06             ` Fāng-ruì Sòng
2021-06-18  0:24               ` H.J. Lu
2021-06-18  0:49                 ` Fāng-ruì Sòng
2021-06-18  2:40                   ` H.J. Lu
2021-06-21 14:35                     ` Michael Matz
2021-06-22 14:30                       ` H.J. Lu
2021-06-22 14:54                         ` Michael Matz [this message]
2021-06-18  2:45                   ` H.J. Lu
2021-06-18 15:38 ` RFC: Add GNU_PROPERTY_1_NEEDED H.J. Lu
2021-06-18 21:34   ` [llvm-dev] " Fangrui Song
2021-06-19  1:09     ` 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=alpine.LSU.2.22.394.2106221436590.6035@wotan.suse.de \
    --to=matz@suse.de \
    --cc=binutils@sourceware.org \
    --cc=gcc@gcc.gnu.org \
    --cc=gnu-gabi@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=llvm-dev@lists.llvm.org \
    --cc=maskray@google.com \
    /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).