3 ms·
So what if several functions that use less than 4KB each call each other before using the stack variables in a way that the first access skips over one page?
by stkdump 2mo ago
So what if several functions that use less than 4KB each call each other before using the stack variables in a way that the first access skips over one page?
- st_goliath 2mo agoA function call causes the return address to be pushed onto the stack, thus accessing the stack below the adjusted stack pointer address. On compiler generated x86 code, the base pointer register will quickly follow when entering the target function.
- stkdump 2mo agoMakes sense. The only exception - tail call optimization where no (new) return address is pushed - relies on cleaning up the stack before executing the tail call.