通过linux x86-64函数调用可以保留哪些寄存器

问题描述:

我相信我了解linux x86-64 ABI如何使用寄存器和堆栈将参数传递给函数(请参阅

I believe I understand how the linux x86-64 ABI uses registers and stack to pass parameters to a function (cf. previous ABI discussion). What I'm confused about is if/what registers are expected to be preserved across a function call. That is, what registers are guarenteed not to get clobbered?

以下是文档[

r12r13r14r15rbxrsprbp是被调用方保存的寄存器-它们在跨函数调用保留"中具有是" 列.

r12, r13, r14, r15, rbx, rsp, rbp are the callee-saved registers - they have a "Yes" in the "Preserved across function calls" column.