From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17399 invoked by alias); 26 Jul 2013 07:38:04 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 17364 invoked by uid 89); 26 Jul 2013 07:38:03 -0000 X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RDNS_NONE,SPF_NEUTRAL autolearn=no version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from Unknown (HELO popelka.ms.mff.cuni.cz) (195.113.20.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 07:38:01 +0000 Received: from domone.kolej.mff.cuni.cz (popelka.ms.mff.cuni.cz [195.113.20.131]) by popelka.ms.mff.cuni.cz (Postfix) with ESMTPS id D942468298; Fri, 26 Jul 2013 09:37:50 +0200 (CEST) Received: by domone.kolej.mff.cuni.cz (Postfix, from userid 1000) id 6443F5FC15; Fri, 26 Jul 2013 09:37:50 +0200 (CEST) Date: Fri, 26 Jul 2013 07:38:00 -0000 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: bugdal at aerifal dot cx Cc: glibc-bugs@sourceware.org Subject: Re: [Bug dynamic-link/15786] ifunc resolver functions can smash function arguments Message-ID: <20130726073749.GA5582@domone.kolej.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-07/txt/msg00154.txt.bz2 On Fri, Jul 26, 2013 at 07:29:14AM +0000, bugdal at aerifal dot cx wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=15786 > > Rich Felker changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |bugdal at aerifal dot cx > > --- Comment #4 from Rich Felker --- > This is definitely a bug in gcc. It is impossible to write "a function that > does not clobber register X" without writing pure assembly, because the > compiler is free to use any non-call-saved register for any purpose it likes. > Even a simple for loop that performs copying might get optimized to use vector > registers. > > Moreover, I believe this bug is related to existing bug reports (I'm not sure > of their status) for the non-ifunc resolver. If I'm not mistaken, right now, > it's tiptoeing around the vector registers by avoiding calling certain string > functions. This is of course wrong because it's making assumptions about the > compiler's choice of register usage in code generation. Both issues would be > fixed, and the code would cease to be senselessly fragile, if the asm entry > point for the resolver simply saved and restored all call-clobbered registers > like it should. > Another issue caused by not saving floating point registers. I will sumbit patch to save fp registers.