public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 2/2] Add an x86 IFUNC testcase for [BZ #20019]
Date: Tue, 04 Oct 2016 22:55:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1610042253170.17011@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAMe9rOrvz5nZZUVMq5qc_FT2g9iKzpGQ6-ydESmmm3CP5BVmJg@mail.gmail.com>

On Tue, 4 Oct 2016, H.J. Lu wrote:

> On Tue, Oct 4, 2016 at 2:27 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> > On Tue, 4 Oct 2016, H.J. Lu wrote:
> >
> >> If an IFUNC function is called before the providing shared library is
> >> unrelocated, ld.so may segfault.  Add a testcase to verify that ld.so
> >> will issue a diagnostic and won't segfault in this case.
> >>
> >> Tested on i686 and x86-64.  OK for master?
> >
> > I can't see anything x86-specific about these tests.  If they are meant to
> > work, they should work on all architectures, and so should be
> > architecture-independent.  Is the architecture-specific thing the use of
> > memmove as a function that uses IFUNCs?  If so, the tests should still
> > work on other architectures, just maybe be less effective as tests (and
> > other architecture maintainers could always add a hook to use another
> > function instead of memmove).
> 
> The result of this test is IFUNC implementation specific.  The older
> x86 IFUNC implementation had
> 
> # define INIT_ARCH() \
>   do                                                    \
>     if (__cpu_features.kind == arch_kind_unknown)       \
>       __init_cpu_features ();                           \
>   while (0)
> 
> The new implementation assumed that relocations in libc.so were
> processed first.  It is hard for me to tell if other IFUNC implementations
> have the similar restriction.

You seem to be saying there was some bug in the x86 IFUNC implementation 
such that you don't know whether a corresponding bug might be present for 
other architectures or not.  That is a very strong indication that the 
tests should be architecture-independent, so that people can use the 
results of those tests on other architectures to tell whether those other 
architectures need fixing as well.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2016-10-04 22:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 18:46 H.J. Lu
2016-10-04 21:27 ` Joseph Myers
2016-10-04 22:21   ` H.J. Lu
2016-10-04 22:55     ` Joseph Myers [this message]
2016-10-05  0:05       ` H.J. Lu
2016-10-05  0:10         ` Joseph Myers
2016-10-05 18:16           ` H.J. Lu
2016-10-06 21:28             ` Adhemerval Zanella
2016-10-12  5:45             ` Carlos O'Donell
2016-10-12 22:19               ` H.J. Lu
2017-01-13 19:03                 ` H.J. Lu
2017-01-13 19:30                   ` Khem Raj
2017-01-13 20:16                     ` H.J. Lu
2017-01-19 18:43                       ` Khem Raj
2017-01-20 17:00                         ` H.J. Lu
2017-01-20 18:36                           ` Khem Raj
2017-01-20 19:02                             ` H.J. Lu
2017-01-20 20:41                               ` Khem Raj

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.DEB.2.20.1610042253170.17011@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.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).