On Mon, Sep 21, 2015 at 06:23:54PM +0200, Marc Marí wrote:
On Mon, 21 Sep 2015 12:03:29 -0400 "Kevin O'Connor" firstname.lastname@example.org wrote:
Also, your code seems to run regular 32bit code when in "long mode" - is that valid?
It doesn't crash. And I think it's valid. When dissasembling, the 64 bit operations have the prefix 0x48, the same that happens in a "normal" 64 bit application.
It looks like "push" and "pop" have different semantics in "long mode". It looks like they decrement the stack by 8 bytes even for 32bit operands. There may be other instructions as well.
So, I don't think we'd want to run 32bit generated gcc code when in 64bit mode.