On Wed, Mar 18, 2009 at 02:17:57PM -0600, Myles Watson wrote:
I think the breakage is occurring before the payload executes, but I'm not sure of that.
qemu: fatal: Trying to execute code outside RAM or ROM at 0xf10002ba
The bug is in src/arch/i386/boot/boot.c. The inline assembly in jmp_to_elf_entry uses the "g" flag to pass in parameters. However, "g" allows gcc to use stack relative addressing of parameters. Unfortunately, the inline assembly modifies %esp - and thus the stack relative values become incorrect.
As a guess, without -fomit-frame-pointer, gcc would pass use %ebp relative values and this wouldn't trigger - but regardless it is still a bug.
-Kevin