调用在x64约定 [英] Calling convention on x64

查看:160
本文介绍了调用在x64约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在微软的调用约定为 64 平台被缩小到只有一个几个地方看到:来电清除栈( CDECL ),和参数传递的堆栈和寄存器(我不打算进入的具体细节在这里)的组合。我认为,如果这是操作系统的调用约定,那么很可能针对Windows的所有其他的编译器(如MinGW的-W64)遵循了这一点。

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.

这是调用约定真还对其他主要平台( 64 Linux等)?还是Linux的仍然使用多个调用约定,甚至只是一个,但不同呢?做 GCC 允许在 64 多个调用约定Linux呢?

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?

推荐答案

我刚刚找到了答案的这里和<一href="http://stackoverflow.com/questions/4429398/why-does-windows64-use-a-different-calling-convention-from-all-other-oses-on-x86">here.基本上,Windows不会是单向的,每个人都做它的另一种方式,但每个平台只做这一种方式(而不是每个平台的多种方式与 86

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)

这篇关于调用在x64约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆