public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rich Felker <dalias@libc.org>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Szabolcs Nagy <szabolcs.nagy@arm.com>,
	Szabolcs Nagy <nsz@port70.net>,	"H.J. Lu" <hjl.tools@gmail.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	Mike Stump <mikestump@comcast.net>,
	Jack Howarth <howarth.at.gcc@gmail.com>,
	Ian Lance Taylor <ian@airs.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Iain Sandoe <iain@codesourcery.com>,
	Rainer Orth <ro@cebitec.uni-bielefeld.de>
Subject: Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE
Date: Mon, 11 May 2015 14:12:00 -0000	[thread overview]
Message-ID: <20150511141114.GR17573@brightrain.aerifal.cx> (raw)
In-Reply-To: <20150511103151.GW1751@tucnak.redhat.com>

On Mon, May 11, 2015 at 12:31:51PM +0200, Jakub Jelinek wrote:
> On Mon, May 11, 2015 at 11:20:15AM +0100, Szabolcs Nagy wrote:
> > 
> > 
> > On 09/05/15 19:57, Szabolcs Nagy wrote:
> > > * H.J. Lu <hjl.tools@gmail.com> [2015-05-09 10:41:41 -0700]:
> > >> There are
> > >>
> > >>      4: 0000000000002b70   806 FUNC    GLOBAL DEFAULT   12
> > >> __cpu_indicator_init@GCC_4.8.0
> > >>     38: 00000000002153d0    16 OBJECT  GLOBAL DEFAULT   25 __cpu_model@GCC_4.8.0
> > >>
> > >> and
> > >>
> > >> 000000000215000  0000000400000001 R_X86_64_64
> > >> 0000000000002b70 __cpu_indicator_init@GCC_4.8.0 + 0
> > >> 0000000000215220  0000002600000006 R_X86_64_GLOB_DAT
> > >> 00000000002153d0 __cpu_model@GCC_4.8.0 + 0
> > >>
> > >> in libgcc_s.so.1.  Musl ld.so must be fixed to handle it.
> > >>
> > 
> > Rich is looking at how to do this non-intrusively, but
> > it seems non-trivial (some users of musl prefer not to
> > resolve such versioned symbols).
> > 
> > > 
> > > i think it might be enough to add __cpu_indicator_init_local
> > > as an alias to __cpu_indicator_init in libgcc.a and then use
> > > the *_local symbol from the ifunc resolver, that way no new
> > > dependency is added to libgcc_s.so handling.
> > 
> > i tried this approach and it seems to work: passes all
> > multiversioning tests on x86_64.
> > 
> > i think it's no worse than the symver approach.
> > 
> > is it ok to change the current fix to this?
> 
> No.  Instead of piling hacks like this just fix it in musl.

I wouldn't call it piling hacks; it's an improvement as far as I can
tell since it remove symbolic relocations and replaces them with
relative ones.

> libgcc certainly isn't the only library that uses @ symbol versions,
> e.g. libstdc++ does as well, as well as many other shared libraries.

We haven't encountered such issues there.

Rich

  parent reply	other threads:[~2015-05-11 14:12 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  2:25 H.J. Lu
2015-03-30  2:34 ` H.J. Lu
2015-03-30  2:40   ` H.J. Lu
2015-03-30 22:26     ` H.J. Lu
2015-03-31  0:54       ` Jack Howarth
2015-03-31  2:08         ` H.J. Lu
2015-03-31  2:42           ` H.J. Lu
2015-03-31  3:14             ` Jack Howarth
2015-03-31  3:09           ` Jack Howarth
2015-03-31  4:04             ` H.J. Lu
2015-03-31  5:39           ` Jakub Jelinek
2015-03-31  6:20             ` Rainer Orth
2015-03-31 10:39             ` H.J. Lu
2015-03-31 14:25               ` Jack Howarth
2015-03-31 15:58                 ` H.J. Lu
2015-03-31 16:10                   ` Jack Howarth
2015-03-31 16:15                     ` H.J. Lu
2015-03-31 16:39                       ` Jack Howarth
2015-03-31 17:00                         ` H.J. Lu
2015-03-31 18:33                           ` Jack Howarth
2015-04-14 15:07                             ` H.J. Lu
2015-04-16 16:29                               ` Mike Stump
2015-04-17  8:05                                 ` Uros Bizjak
2015-04-17 10:36                                   ` H.J. Lu
2015-04-17 11:04                                     ` Uros Bizjak
2015-04-17 11:12                                       ` Uros Bizjak
2015-04-17 11:38                                       ` Jakub Jelinek
2015-04-17 11:48                                         ` H.J. Lu
2015-04-17 12:00                                           ` Jakub Jelinek
2015-04-17 12:36                                             ` H.J. Lu
2015-04-17 12:40                                               ` Jakub Jelinek
2015-05-08 23:00                                               ` Rich Felker
2015-05-08 23:59                                                 ` H.J. Lu
2015-05-09 14:31                                               ` Szabolcs Nagy
2015-05-09 17:41                                                 ` H.J. Lu
2015-05-09 18:57                                                   ` Szabolcs Nagy
2015-05-11 10:20                                                     ` Szabolcs Nagy
2015-05-11 10:32                                                       ` Jakub Jelinek
2015-05-11 12:39                                                         ` Szabolcs Nagy
2015-05-11 13:05                                                           ` Jakub Jelinek
2015-05-11 15:30                                                             ` Szabolcs Nagy
2015-05-11 14:12                                                         ` Rich Felker [this message]
2015-05-09 19:36                                                   ` Rich Felker
2015-05-09 19:54                                                     ` Jakub Jelinek
2015-07-22 21:14                                               ` Sriraman Tallam
2015-04-17 12:23                                   ` Mike Stump

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=20150511141114.GR17573@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=howarth.at.gcc@gmail.com \
    --cc=iain@codesourcery.com \
    --cc=ian@airs.com \
    --cc=jakub@redhat.com \
    --cc=mikestump@comcast.net \
    --cc=nsz@port70.net \
    --cc=ro@cebitec.uni-bielefeld.de \
    --cc=szabolcs.nagy@arm.com \
    --cc=ubizjak@gmail.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).