The ARM Embedded Application Binary Interface (EABI) is a standard that defines how executable code interacts with the system software and hardware on ARM-based processors. It specifies details like calling conventions, register usage, stack organization, and data type representations to enable compatibility between different compilers, operating systems, and applications running on ARM devices.
Background
In the early days of ARM processors, there were no standards for writing code. Each compiler vendor had their own conventions and assumptions. This meant that object code generated by one compiler often could not work with code from another compiler, or with different operating systems. There was no binary compatibility.
To address this problem, ARM introduced the Embedded Application Binary Interface in 2006. It provided a consistent set of interfaces that all parties could rely on when building their compilers, operating systems, and applications. This enabled greater interoperability and helped accelerate the adoption of ARM in embedded devices.
Main Components
The EABI standard defines conventions in several key areas:
Calling Conventions
The calling conventions specify how subroutines receive parameters from the caller and return values back to the caller. This covers details like:
- Which registers are used to pass the first few parameters
- Which registers must be preserved by callee functions
- How the stack is used for additional parameters
- Who is responsible for removing parameters from the stack after calls
Following consistent conventions enables separately compiled code to interoperate correctly.
Function ABI
The function ABI defines how functions interact with the calling environment, covering aspects like:
- Frame pointer register usage
- Stack frame organization
- Stack alignment
- Use of link register
This allows unwinding stack frames, debugging, and exception handling to work reliably across different compilers.
Base Data Types
The base data types specify standard storage sizes and binary representations for fundamental data types like integers, floating point values, and pointers. For example:
- int is 32-bit
- long int is 32-bit
- long long int is 64-bit
- float is 32-bit IEEE 754
- double is 64-bit IEEE 754
This ensures consistent in-memory layout of data structures and calling semantics across languages and compilers.
Aggregate Data Types
Aggregate types like structures and arrays have additional ABI rules governing their alignment, padding, and endianness. This ensures that composite types maintain their expected layouts when accessed from different language or compiler environments.
Register Usage
The EABI specifies standard purposes for certain general purpose registers. For example, ip is expected to be used as an inter-procedural scratch register. This allows compilers to generate better code knowing that certain registers have defined usages across boundaries.
Stack Usage
The ABI defines important aspects related to use of the stack like direction of growth, alignment, and organization of stack frames. It also defines a dedicated stack limit register that code can query for bounds checking.
Exception Handling
The EABI specifies mechanisms for exception handling and unwinding using frame pointers. This enables languages like C++ that rely on exception handling to work properly across different compilers and operating systems.
Impact
Adoption of EABI has brought significant benefits:
- Compilers can generate compliant object code, enabling interoperability
- Source code can be compiled with different EABI compilers
- Libraries built with one compiler can be reused by others
- Operating systems adhere to the conventions, improving reliability
- Debuggers and tools work seamlessly across compiler boundaries
- Applications are portable across OS and hardware platforms
This has accelerated ARM’s growth in embedded systems by cultivating a healthy cross-vendor ecosystem of compatible software.
Versions
There have been several major versions of the ARM EABI standard:
- EABI baseline – Introduced in 2005
- EABI v2 – Added support for C++ exception handling and stack limit registers
- EABI v3 – Removed frame pointer requirement for simpler cores
- EABI v4 – Relaxed float-argument passing rules
- EABI v5 – Further simplifications for microcontroller profile
Within each major version, there are also architecture variants like the standard ARM core profile, the microcontroller profile, and profiles for architectures like Thumb2 and M-profile. This allows customization of the ABI for different ARM core types while retaining overall compatibility.
Ongoing Development
ARM continues evolving the EABI specifications to support new features and simplify adoption for a wider range of devices:
- Support for 64-bit architectures like ARMv8-A
- Extended parameter passing conventions
- AArch32 virtualization extensions
- armv8.1 atomics and memory model extensions
- Relaxed exception propagation and unwinding requirements
The ABI gives software providers a stable target for compatibility across the extensive ARM ecosystem. With over 100 billion ARM chips shipped to date in everything from mobile to automotive and IoT devices, this unified ABI foundation has been essential for the architecture’s reach.