This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
Re: [Bug dynamic-link/15786] ifunc resolver functions can smash function arguments
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: bugdal at aerifal dot cx <sourceware-bugzilla at sourceware dot org>
- Cc: glibc-bugs at sourceware dot org
- Date: Fri, 26 Jul 2013 09:37:49 +0200
- Subject: Re: [Bug dynamic-link/15786] ifunc resolver functions can smash function arguments
- References: <bug-15786-131 at http dot sourceware dot org/bugzilla/> <bug-15786-131-BxORhj45sV at http dot sourceware dot org/bugzilla/>
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 <bugdal at aerifal dot cx> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |bugdal at aerifal dot cx
>
> --- Comment #4 from Rich Felker <bugdal at aerifal dot cx> ---
> 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.