[cfe-dev] linux/i386 and mregparm

Anton Korobeynikov anton at korobeynikov.info
Tue Mar 1 11:59:51 PST 2011


> for the non-rip relative case i don't see why accepting negative offsets is
> wrong whereas it's considered correct for the small model. i.e., what is the
> programming construct that
>  1. produces such negative offsets and
>  2. is correct for small mode and
>  3. is wrong for the kernel?
According to x86-64 ABI (see
http://www.x86-64.org/documentation/abi.pdf, section 3.5.1 for more
information), kernel resides in negative 32 bit space.
This means that if we'll have negative offset here it might just wrap
around and we won't be able to fit the stuff into 32 bit and have very
big positive addresses. See the note in that section about the offsets
wrt symbolic references.

PS: gcc behaves the same way wrt negative offsets for kernel code model.
-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the cfe-dev mailing list