What is an application binary interface (ABI)?

后端 未结 16 1633
情歌与酒
情歌与酒 2020-11-22 11:41

I never clearly understood what an ABI is. Please don\'t point me to a Wikipedia article. If I could understand it, I wouldn\'t be here posting such a lengthy post.

16条回答
  •  被撕碎了的回忆
    2020-11-22 12:14

    Application binary interface (ABI)

    Functionality:

    • Translation from the programmer's model to the underlying system's domain data type, size, alignment, the calling convention, which controls how functions' arguments are passed and return values retrieved; the system call numbers and how an application should make system calls to the operating system; the high-level language compilers' name mangling scheme, exception propagation, and calling convention between compilers on the same platform, but do not require cross-platform compatibility...

    Existing entities:

    • Logical blocks that directly participate in program's execution: ALU, general purpose registers, registers for memory/ I/O mapping of I/O, etc...

    consumer:

    • Language processors linker, assembler...

    These are needed by whoever has to ensure that build tool-chains work as a whole. If you write one module in assembly language, another in Python, and instead of your own boot-loader want to use an operating system, then your "application" modules are working across "binary" boundaries and require agreement of such "interface".

    C++ name mangling because object files from different high-level languages might be required to be linked in your application. Consider using GCC standard library making system calls to Windows built with Visual C++.

    ELF is one possible expectation of the linker from an object file for interpretation, though JVM might have some other idea.

    For a Windows RT Store app, try searching for ARM ABI if you really wish to make some build tool-chain work together.

提交回复
热议问题