This is the mail archive of the
mailing list for the glibc project.
Re: [google][4.7]Using CPU mocks to test code coverage of multiversioned functions
- From: Sriraman Tallam <tmsriram at google dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>, Xinliang David Li <davidxl at google dot com>, Sriraman Tallam <tmsriram at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, GLIBC Devel <libc-alpha at sourceware dot org>, amodra at gmail dot com
- Date: Mon, 25 Mar 2013 14:24:21 -0700
- Subject: Re: [google][4.7]Using CPU mocks to test code coverage of multiversioned functions
- References: <CAAs8HmyUjEf5ecGBerysqSFgOq3SC0esvN3AnEJm5O_kxzrGyQ at mail dot gmail dot com> <CAFiYyc0FSA-hZ0YQr0b9DXUO0S-Nf4OfLzgA5uYi3DDTai75Rg at mail dot gmail dot com> <CAAkRFZLLx9b=ECQ0P0rbX0YqCasY7YhjV+cvdKZC_0nOz9UM5g at mail dot gmail dot com> <CALoOobPj=1E8gR=_kXwYHJ1FRSBaozuzFj_J3zZ6xJAuzWacKQ at mail dot gmail dot com> <CAMe9rOrn6iuSgCzKctaZGX02rACXE3YGc+=iN287c3e+eHzRNg at mail dot gmail dot com> <22407982-cd6c-4d91-a2a4-472365c1ecd2 at email dot android dot com> <20130319054405 dot GI18331 at bubble dot grove dot modra dot org>
On Mon, Mar 18, 2013 at 10:44 PM, Alan Modra <firstname.lastname@example.org> wrote:
> On Mon, Mar 18, 2013 at 06:18:58PM +0100, Richard Biener wrote:
>> I was asking for the ifunc selector to be
>> Overridable by ld_preload or a similar mechanism at dynamic load time.
> Please don't. Calling an ifunc resolver function in another library
> is just asking for trouble with current glibc. Why? Well, the other
> library containing the resolver function may not have had any dynamic
> relocations applied. So if the resolver makes use of the GOT (to read
> some variable), it will use unrelocated addresses. You'll segfault if
> you're lucky.
Does this also mean that Paul's idea of doing:
LD_CPU_FEATURES=sse,sse2 ./a.out # run as if only sse and sse2 are available
is fraught with risk when used with IFUNC, particularly on x86_64?
Shouldn't the IFUNC resolver go through the GOT even in this case.
This could work well for the MV testing problem I explained earlier,
but if this is not feasible with IFUNC in play I would like my
original proposal reconsidered.
> For anyone playing with ifunc, please test out your great ideas on
> i386, ppc32, mips, arm, etc. *NOT* x86_64 or powerpc64 which both
> avoid the GOT in many cases.
> Alan Modra
> Australia Development Lab, IBM