From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101844 invoked by alias); 11 May 2015 10:32:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 101832 invoked by uid 89); 11 May 2015 10:32:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 11 May 2015 10:32:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6A3D835C822; Mon, 11 May 2015 10:32:06 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-89.ams2.redhat.com [10.36.116.89]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4BAW3ZU028867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 11 May 2015 06:32:05 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t4BAW0YI020368; Mon, 11 May 2015 12:32:00 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t4BAVpsL020367; Mon, 11 May 2015 12:31:51 +0200 Date: Mon, 11 May 2015 10:32:00 -0000 From: Jakub Jelinek To: Szabolcs Nagy Cc: Szabolcs Nagy , "H.J. Lu" , Uros Bizjak , Mike Stump , Jack Howarth , Ian Lance Taylor , GCC Patches , Iain Sandoe , Rainer Orth , Rich Felker Subject: Re: PATCH] PR target/65612: Multiversioning doesn't work with DSO nor PIE Message-ID: <20150511103151.GW1751@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20150417113731.GL1725@tucnak.redhat.com> <20150417115950.GM1725@tucnak.redhat.com> <20150509143104.GA26462@port70.net> <20150509185737.GA31118@port70.net> <5550825F.1050300@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5550825F.1050300@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00901.txt.bz2 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 [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. Jakub