From Surf Wiki (app.surf) — the open knowledge base
Application binary interface
Interface to software defined in terms of in-process, machine code access
Interface to software defined in terms of in-process, machine code access
An application binary interface (ABI) is an interface exposed by software that is defined for in-process machine code access. Often, the exposing software is a library, and the consumer is a program.
An ABI is at a relatively low level of abstraction. Interface compatibility depends on the target hardware and the software build toolchain. In contrast, an application programming interface (API) defines access in source code, which is a relatively high-level, hardware-independent, and human-readable format. An API defines an interface at the source code level, before compilation, whereas an ABI defines an interface to compiled code.
API compatibility is generally the concern for system design and of the toolchain. However, a programmer may have to deal with an ABI directly when writing a program in multiple languages or when using multiple compilers for the same language.
A complete ABI enables a program that supports an ABI to run without modification on multiple operating systems that provide the ABI. The target system must provide any required libraries (that implement the ABI), and there may be other prerequisites.
Description
Interface aspects covered by an ABI include:
- Processor instruction set, with details like register file structure, memory access types, etc.
- Size, layout, and alignment of basic data types that the processor can directly access
- Calling convention, which controls how the arguments of functions are passed, and return values retrieved; for example, it controls the following:
- How the call stack is organized
- Whether all parameters are passed on the call stack, or some are passed in registers
- Which registers are used for which function parameters
- Whether the first function parameter passed on the call stack is pushed first or last
- Whether the caller or callee is responsible for cleaning up the call stack after the function call
- Name mangling
- Exception propagation
- How an application should make system calls to the operating system, and if the ABI specifies direct system calls rather than procedure calls to system call stubs, the system call numbers
- In the case of a complete operating system ABI, the binary format of object files, program libraries, etc.
ABIs include the Intel Binary Compatibility Standard (iBCS) and the System V Release 4 ABIs for various instruction sets.
{{Anchor|EABI}}Embedded ABI
An embedded ABI (EABI), used on an embedded operating system, specifies aspects such as file formats, data types, register usage, stack frame organization, and function parameter passing of an embedded software program.
Each compiler and assembler that supports an EABI creates object code that is compatible with code generated by other such compilers and assemblers. This allows developers to link libraries generated by one compiler with object code generated by another.
Typically, an EABI is optimized for performance for the limited resources of the target embedded system. Therefore, an EABI may omit abstractions between kernel and user space typically found in desktop operating systems. For example, dynamic linking may be avoided to allow smaller executables and faster loading, fixed register usage allows more compact stacks and kernel calls, and running the application in privileged mode allows direct access to custom hardware operation without the indirection of calling a device driver.{{cite book |access-date=11 October 2007 |archive-url=https://web.archive.org/web/20070121183413/http://www.linuxdevices.com/news/NS9048137234.html |archive-date=21 January 2007 |url-status=dead |access-date=11 October 2007 |archive-url=https://web.archive.org/web/20070331193917/http://www.linuxdevices.com/articles/AT5920399313.html |archive-date=31 March 2007 |url-status=dead
Widely used EABIs include the PowerPC, Arm, and MIPS EABIs. Specific software implementations like the C library may impose additional limitations to form more concrete ABIs; one example is the GNU OABI and EABI for ARM, both of which are subsets of the ARM EABI.
References
References
- "Itanium C++ ABI".
- "Itanium C++ ABI: Exception Handling".
- "Intel Binary Compatibility Standard (iBCS)".
- "ABI for the Arm Architecture". Developer.arm.com.
- Eric Christopher. (11 June 2003). "mips eabi documentation".
- "ArmEabiPort".
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about Application binary interface — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report