This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: i386/x86_64 segment register issuses
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: Ross Ridge <rridge at csclub dot uwaterloo dot ca>,binutils at sources dot redhat dot com
- Date: Mon, 28 Mar 2005 01:57:17 -0500 (EST)
- Subject: Re: i386/x86_64 segment register issuses
> The current gas will accept this and. But if fsindex is ever a memory
> operand,
>
> asm volatile("movl %%fs,%0" : "=g" (fsindex));
>
> fsindex will have some random value in the upper 16bits.
fsindex will have whatever value it had before in the upper 16-bits.
It's only undefined because of a bug in the Linux kernel, not because
the instruction itself ever produces an undefined result when a memory
operand is used. This kind of move instruction can never have a 32-bit
memory operand.
Ross Ridge