main.c
int enable; int test = 1; int main() { int temp; return 0; } int add() { return 0; }
elf反汇编结果如下,可以看出main函数中的栈多开了8字节,虽然局部变量只是int,占4字节
这是因为堆栈是要求8字节对齐的,为了能够使用更高效的LDD,STD指令,v8 manual,p191.
The stack pointer %sp must always be doubleword-aligned. This allows window
overflow and underflow trap handlers to use the more efficient STD and LDD
instructions to store and reload register windows.