This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]