Calling convention on x64

依然范特西╮ 提交于 2020-01-10 02:57:18

问题


I saw in several places that Microsoft calling conventions for x64 platforms were narrowed down to just one: Caller cleans stack (cdecl), and parameters are passed in a combination of stack and registers (I am not going into the exact details here). I assume that if this is the calling convention of the OS, then probably all other compilers targeting Windows (e.g. mingw-w64) follow it, too.

Is this calling convention true also on other major platforms (x64 Linux, etc.)? Or does Linux still use multiple calling conventions, or even just one but a different one? Do GCC or Clang allow for multiple calling conventions on x64 Linux?


回答1:


I just found the answer here and here. Basically, Windows does it one way, everyone else does it another way, but each platform only does it one way (as opposed to multiple ways per-platform with x86)



来源:https://stackoverflow.com/questions/18135871/calling-convention-on-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!