Application Binary Interface
Application Binary Interface (ABI) is a standard that defines the interface between compiled applications and the operating system on a computer platform. This standard specifies how compiled code is generated, how data structures and functions are organized, how memory management is done, and how system calls are made.
Data Structures and Sizes: ABI determines which data types will be used, their sizes, and endianness. For example, the usage and representation of data types such as integers, floating-point numbers, pointers, structures, and arrays are determined by ABI.
Function Call Rules: ABI specifies how function calls are made, how parameters are passed, how return values are obtained, and how the post-call state is cleaned up. For example, parameters are typically passed in processor registers or on the stack, and optimizations such as fastcall may be applied in some cases.
Register Usage: ABI determines which processor registers will be used for which purposes. For example, certain registers may be allocated for function parameters or temporary variables.
Stack Structure and Usage: ABI determines the usage of the stack and the organization of data structures on the stack. Situations such as function calls, storage of local variables, and system calls are handled on the stack.
System Calls and Interfaces: ABI specifies the structure and interface of system calls necessary for interaction with the operating system or other system components. For example, functions such as file operations, network access, and memory management are called and parameters are passed as determined by ABI.
Symbolic Information and File Formats: ABI includes elements such as the configuration of compiled code, usage of libraries, file formats, and symbol tables. Particularly, issues such as dynamically linked libraries and runtime linking are defined by ABI.
Memory Management: ABI defines the standards required for memory management. This includes topics such as how memory blocks are allocated, how they are deallocated, and how memory segments are managed. ABI also establishes rules for using standard library functions for memory allocation and deallocation.
Get Derya Cortuk’s stories in your inbox
Join Medium for free to get updates from this writer.
Error Handling and Error Conditions: ABI defines how error conditions are communicated and handled between the operating system and programs. This includes how error codes are returned, how exceptions are handled, and how error conditions are reported.
Thread Support and Synchronization: If an operating system supports multiple threads, ABI typically establishes standards for data sharing and synchronization between threads. This includes how critical sections are protected, how synchronization objects are used, and other measures required for thread safety.
Platform Independence: An ABI can be specific to a certain platform (e.g., x86, ARM, MIPS), but in some cases, it can be platform-independent. A platform-independent ABI can be used to ensure software portability between different operating systems or hardware architectures.
Compatibility with Developer Tools and Compilers: ABI is important for ensuring compatibility with developer tools (compilers, debuggers, profilers, etc.) and other software development tools. In particular, proper implementation of ABI standards by compilers and other tools enhances software compatibility and portability.
Floating Point Format: ABI establishes standards for the representation of floating-point numbers and the use of processor-specific floating-point formats. This is important for combining floating-point operations and ensuring compatibility.
C++ ABI: Additional criteria are established for supporting specific features and object-oriented programming in the C++ language. Especially, topics such as how virtual functions will be placed, how multiple inheritance will be supported, and the management of pointer-based objects are defined by the C++ ABI.
Storage and File Formats: ABI establishes criteria for how compiled programs will be stored and how file formats will be created. Especially, topics such as object-oriented file formats, creation of relocatable files, and configuration of shared libraries are covered.
Software Update and Compatibility: ABI addresses software update and backward compatibility issues. This is important for updating existing applications, ensuring compatibility with modified or new ABIs, and meeting backward compatibility requirements.
ABI plays a critical role in ensuring the compatibility of applications and the operating system, as well as compatibility between programs written in different languages and different compilers.








