This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: "H. Peter Anvin" <hpa at zytor dot com>
- Cc: Aurelien Jarno <aurelien at aurel32 dot net>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- Date: Wed, 5 Mar 2008 11:58:34 -0800
- Subject: Re: Linux doesn't follow x86/x86-64 ABI wrt direction flag
- References: <20080305153020.GA24631@volta.aurel32.net> <47CEC3AA.6080709@zytor.com>
Aurelien Jarno wrote:
> >Since version 4.3, gcc changed its behaviour concerning the x86/x86-64
> >ABI and the direction flag, that is it now assumes that the direction
> >flag is cleared at the entry of a function and it doesn't clear once
> >more if needed.
> >...
> >I guess this has to be fixed on the kernel side, but also gcc-4.3 could
> >revert back to the old behaviour, that is clearing the direction flag
> >when entering a routine that touches it until most people are running a
> >fixed kernel.
On Wed, Mar 05, 2008 at 08:00:42AM -0800, H. Peter Anvin wrote:
> Linux should definitely follow the ABI. This is a bug, and a pretty
> serious such.
Unfortunately, there are a lot of kernels out there already with this
problem, and the symptoms are likely to be subtle. So even if it is true
that it is the kernel that is "in the wrong", I think we still are going
to need to give users a workaround from the gcc side as well.
So I think gcc at least needs an *option* to revert to the old behavior,
and there's a good argument to make it the default for now, at least for
x86/x86-64 on Linux.