Enabling compiler optimizations ruins the kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Enabling compiler optimizations ruins the kernel

Post 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.
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

Re: Enabling compiler optimizations ruins the kernel

Post by devc1 »

Thank you so much : )
Post Reply