From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66753 invoked by alias); 4 Oct 2016 22:55:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 66737 invoked by uid 89); 4 Oct 2016 22:55:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=indication X-HELO: relay1.mentorg.com Date: Tue, 04 Oct 2016 22:55:00 -0000 From: Joseph Myers To: "H.J. Lu" CC: GNU C Library Subject: Re: [PATCH 2/2] Add an x86 IFUNC testcase for [BZ #20019] In-Reply-To: Message-ID: References: <20161004184621.GB27454@intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2016-10/txt/msg00077.txt.bz2 On Tue, 4 Oct 2016, H.J. Lu wrote: > On Tue, Oct 4, 2016 at 2:27 PM, Joseph Myers 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