Page 5 of 5

Re: Enabling compiler optimizations ruins the kernel

Posted: Mon Oct 03, 2022 4:09 pm
by Octocontrabass
devc1 wrote:the stack pointer (RSP) wasn't 16 bytes aligned, I tried to add 8 bytes on the stack address (in KrnlEntry) and it worked.
So what causes this stack misalignment ? is it also the ABI ?
Yes. The stack must be 16-byte aligned before a function call. The call pushes an 8-byte return address, so every function will start with an 8-byte misaligned stack.

Re: Enabling compiler optimizations ruins the kernel

Posted: Mon Oct 03, 2022 4:12 pm
by devc1
Thank you so much : )