星期一, 7月 06, 2009

What is ABI, EABI and OABI

What is ABI, EABI and OABI
--------------------------
What is ABI:
ABI = Application Binary Interface

什麼是ABI(Application Binary Interface)?

ABI 定義:
就像 API (Application Interface) 是原始碼的介面,ABI 是低階的二元碼介面。

ABI 用途:
ABI 是用來確定二元檔的相容性,以保證目地碼(object code)在使用相同的 ABI 時,
在任何的系統上都不需要重新編譯(recompilation)。

ABI 影響到的東西有:
calling coventions
byte ordering
register use
system call invocation
linking
library behavior
binary object format

calling coventions 是指函式如何被引用,引數如何傳遞,暫存器哪個該保留或
哪個該使用,與調用的函式如何接收與傳回數值,之類的函式呼叫慣例。

ABI 特性:
ABI 是與硬體特性相關的,各平台(architecture)的 ABI 都不一樣。


Reference:
O'Reilly Linux System Programming, Chapter 1.

ABIs

Whereas an API defines a source interface, an ABI defines the low-level binary interface
between two or more pieces of software on a particular architecture. It defines
how an application interacts with itself, how an application interacts with the kernel,
and how an application interacts with libraries. An ABI ensures binary compatibility,
guaranteeing that a piece of object code will function on any system with the same
ABI, without requiring recompilation.

ABIs are concerned with issues such as calling conventions, byte ordering, register
use, system call invocation, linking, library behavior, and the binary object format.

The calling convention, for example, defines how functions are invoked, how arguments
are passed to functions, which registers are preserved and which are mangled,
and how the caller retrieves the return value.

Although several attempts have been made at defining a single ABI for a given architecture
across multiple operating systems (particularly for i386 on Unix systems), the
efforts have not met with much success. Instead, operating systems—Linux
included—tend to define their own ABIs however they see fit. The ABI is intimately
tied to the architecture; the vast majority of an ABI speaks of machine-specific
concepts, such as particular registers or assembly instructions. Thus, each machine
architecture has its own ABI on Linux. In fact, we tend to call a particular ABI by its
machine name, such as alpha, or x86-64.

System programmers ought to be aware of the ABI,but usually do not need to
memorize it. The ABI is enforced by the toolchain—the compiler, the linker, and so
on—and does not typically otherwise surface. Knowledge of the ABI, however, can
lead to more optimal programming, and is required if writing assembly code or hacking
on the toolchain itself (which is, after all, system programming).
The ABI for a given architecture on Linux is available on the Internet and implemented
by that architecture’s toolchain and kernel.


What is EABI, OABI:

EABI = Embedded ABI or Extended ABI
OABI = Old ABI

[QUOTE]

http://www.oesf.org/index.php?title=Q3:_What_are_OABI_and_EABI%3F

Q3: What are OABI and EABI?

A3: They are two kinds of ABI (Application Binary Interface). The ‘O’
stands for ‘Old’, and the ‘E’ means ‘Embedded’, a new approach to
API for portable devices like the Zaurus.

According to this explanation,

GNU EABI is a new application binary interface (ABI) for Linux. It is
part of a new family of ABI's from ARMR Ltd. known in the arm-linux
community as EABI (or sometimes Embedded ABI).

According to Debian Wiki the new EABI:
Allows mixing softfloat and hardfloat code.
Uses a more efficient syscall convention.
Will be more compatible with future tools.

Furthermore, the GCC default for EABI will be to use softfloat
instructions for floating point arithmetic.

[/QUOTE]

沒有留言: