HOME

TheInfoList



OR:

In
computer software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consist ...
, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vi ...
or
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
facility, and the other is a program that is being run by a user. An ''ABI'' defines how data structures or computational routines are accessed in machine code, which is a low-level, hardware-dependent format. In contrast, an ''API'' defines this access in
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the ...
, which is a relatively high-level, hardware-independent, often
human-readable A human-readable medium or human-readable format is any encoding of data or information that can be naturally read by humans. In computing, ''human-readable'' data is often encoded as ASCII or Unicode text, rather than as binary data. In m ...
format. A common aspect of an ABI is the calling convention, which determines how data is provided as input to, or read as output from, computational routines. Examples of this are the x86 calling conventions. Adhering to an ABI (which may or may not be officially standardized) is usually the job of a
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
, operating system, or library author. However, an application programmer may have to deal with an ABI directly when writing a program in a mix of programming languages, or even compiling a program written in the same language with different compilers.


Description

Details covered by an ABI include the following: * Processor instruction set, with details like register file structure, stack organization, memory access types, etc. * Sizes, layouts, and alignments 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: ** Whether all parameters are passed on the stack, or some are passed in registers ** Which registers are used for which function parameters ** Whether the first function parameter passed on the stack is pushed first or last * 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.


Complete ABIs

A complete ABI, such as the
Intel Binary Compatibility Standard The Intel Binary Compatibility Standard (iBCS) is a standardized application binary interface (ABI) for Unix operating systems on Intel-386-compatible computers, published by AT&T, Intel and SCO in 1988, and updated in 1990. It extends source-lev ...
(iBCS), allows a program from one operating system supporting that ABI to run without modifications on any other such system, provided that necessary shared libraries are present, and similar prerequisites are fulfilled. ABIs can also standardize details such as the C++ name mangling, exception propagation, and calling convention between compilers on the same platform, but do not require cross-platform compatibility.


Embedded ABIs

An ''embedded-application binary interface'' (EABI) specifies standard conventions for file formats, data types, register usage, stack frame organization, and function parameter passing of an embedded software program, for use with an embedded operating system.
Compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
s that support the EABI create object code that is compatible with code generated by other such compilers, allowing developers to link libraries generated with one compiler with object code generated with another compiler. Developers writing their own assembly language code may also interface with assembly generated by a compliant compiler. EABIs are designed to optimize for performance within the limited resources of an embedded system. Therefore, EABIs omit most abstractions that are made between kernel and user code in complex 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. The choice of EABI can affect performance. Widely used EABIs include PowerPC, Arm EABI and MIPS EABI. 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 .


See also

*
Binary-code compatibility Binary-code compatibility (binary compatible or object-code-compatible) is a property of a computer system, meaning that it can run the same executable code, typically machine code for a general-purpose computer CPU, that another computer system ...
*
Bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
* Comparison of application virtual machines * Debugging symbol * Foreign function interface * Language binding * Native (computing) * Opaque pointer * PowerOpen Environment * Symbol table * SWIG * Visual C++ ABI instability details


References


External links


Policies/Binary Compatibility Issues With C++
a compendium of development rules of thumb for not breaking binary compatibility between library releases


Debian ARM EABI port

μClib: Motorola 8/16-bit embedded ABI
*



* a summary and comparison of some popular ABIs
M•CORE Applications Binary Interface Standards Manual
for the Freescale M·CORE processors {{Application binary interface Application programming interfaces Operating system technology