在 wikibookx86 Disassembly
中,写到有时存在不设置标准堆栈帧的子例程。一种这样的情况是当我们在 C 中声明一个静态函数时。以下几行已经写在书中。
When an optimizing compiler sees a static function that is only referenced by calls (no references through function pointers), it "knows" that external functions cannot possibly interface with the static function (the compiler controls all access to the function), so the compiler doesn't bother making it standard
.
我对上述陈述有以下疑问:
- 外部函数是否可以使用函数指针引用静态函数?如果是,如何?为什么允许?(我问这个是因为据我所知,静态函数具有本地范围,并且不能被任何外部函数访问)?
- 非标准堆栈帧是什么意思?非标准堆栈帧与标准堆栈帧有何不同?欢迎使用汇编代码进行解释:)
编辑:另一个我想回答的问题:为什么上述情况下的编译器设置非标准堆栈框架而不是标准堆栈框架?