ABI(Application Binary Interface)定义的内容

• How function parameters are passed in registers and on the stack;
函数的参数传递是通过寄存器还是通过栈来传递的。

• How function values are returned;
函数的返回是如何进行的。

• Which registers must be preserved by a function;


• How objects with automatic storage duration are allocated to stack frames;
局部变量如何分配到堆栈。应该是发生函数调用的时候。

• Alignment requirements for each data type;
不同数据类型,尤其是结构体的对齐和空隙。

• How structures are laid out and how bit-fields are allocated to storage units.
结构体的布局和bit-field的使用。注意,这部分C语言的特性不具备可移植性。

 

参考资料:

《MISRA C:2012 Guidelines for the use of the C language in critical systems 》 March 2013

posted @ 2022-08-08 13:27  panrui  阅读(86)  评论(0编辑  收藏  举报