Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1.4 栈帧布局 中出错 #11

Closed
bjrjk opened this issue Nov 3, 2021 · 1 comment
Closed

4.1.4 栈帧布局 中出错 #11

bjrjk opened this issue Nov 3, 2021 · 1 comment

Comments

@bjrjk
Copy link

bjrjk commented Nov 3, 2021

例如图4.11中的normal函数,用gcc -O2 -S编译的结果如图4.12所示。normal函数调用了一个有9个整数参数的外部函数,这样它必须有栈帧来为调用的子函数准备参数。可以看到,编译器生成了一个32字节的栈帧,把最后一个浮点参数9保存到偏移0,把返回地址$ra保存到偏移24。

其中不论是图 4.11: normal函数代码,还是图 4.12: normal函数的gcc -O2编译结果,都只有整形参数。
没有“浮点”参数。

@foxsen
Copy link
Owner

foxsen commented Nov 4, 2021

感谢,马上修复。

@foxsen foxsen closed this as completed in 7b4bd10 Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants