This is the mail archive of the
mailing list for the GCC project.
Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Szabolcs Nagy <nsz at port70 dot net>, "H.J. Lu" <hjl dot tools at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, Mike Stump <mikestump at comcast dot net>, Jack Howarth <howarth dot at dot gcc at gmail dot com>, Ian Lance Taylor <ian at airs dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Iain Sandoe <iain at codesourcery dot com>, Rainer Orth <ro at cebitec dot uni-bielefeld dot de>, Rich Felker <dalias at libc dot org>
- Date: Mon, 11 May 2015 12:31:51 +0200
- Subject: Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOpim6FhVk=ts3Zd4jfNU+oAXmtpy2aWy+ZP7qJ75E9H8g at mail dot gmail dot com> <CAFULd4bDmOcJ4bm8GpGvNL6-TCZYpZuC79RHGw_+BKD08ZF73A at mail dot gmail dot com> <20150417113731 dot GL1725 at tucnak dot redhat dot com> <CAMe9rOpGbB=UuSg3s437FaedD_mugzYKffdrJJfZEHVQQEBODQ at mail dot gmail dot com> <20150417115950 dot GM1725 at tucnak dot redhat dot com> <CAMe9rOp_Eck1MEOV6btcHLOsd5u0=dtEQDq3iy0QY0RvXwuVDQ at mail dot gmail dot com> <20150509143104 dot GA26462 at port70 dot net> <CAMe9rOp3tg=kJK+kCnDgDMxCpvfqP7kEG9LvwcPbakwNx+Hh_g at mail dot gmail dot com> <20150509185737 dot GA31118 at port70 dot net> <5550825F dot 1050300 at arm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <firstname.lastname@example.org> [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.
libgcc certainly isn't the only library that uses @ symbol versions,
e.g. libstdc++ does as well, as well as many other shared libraries.