ARM⼯具链中的概念——EABI
EABI(Embedded Application Binary Interface),嵌⼊式应⽤程序⼆进制接⼝。
ABI的定义
ABI描述应⽤程序与操作系统、应⽤程序与库、应⽤程序的组成部分之间的低层接⼝。ABI允许编译好的⽬标代码在使⽤兼容ABI的系统中⽆需改动就能运⾏。
EABI的具体定义
Codesourcery上有⼀个这样的QA:
Question
What is the ABI for the ARM Architecture? Is it the same as the ARM EABI?
Answer
The ABI for the ARM Architecture is a standard developed by ARM and its partners that explains how compilers, assemblers, linkers, and other similar tools should generate object files and executable files.
Tools that correctly implement the ABI for the ARM Architecture can interoperate; i.e., object files built with one toolchain can be combined with object files built with another toolchain if both compilers use the ABI for the ARM Architecture and provided that the code compiled observes certain conventions.
CodeSourcery was an active participant in the design of the ABI for the ARM Architecture. (In fact, the C++ ABI used by ARM is derived from the Itanium C++ ABI co-designed by CodeSourcery.) CodeSourcery continues to work with ARM, Ltd. to validate interoperability between Sourcery G++ and ARM's proprietary tools.
The "ARM EABI" is an informal name for the ABI for the ARM Architecture.
The "ARM EABI" is an informal name for the ABI for the ARM Architecture.
这⾥提到了所谓的ARM EABI就是针对 ARM 体系结构的应⽤程序⼆进制接⼝的⾮正式名称。
在arm的infocenter可以到ABI for the ARM architecture的相关⽂档:
“⽤于针对ARM体系结构的应⽤程序⼆进制接⼝(ABI)的ARM⽂档集,这些接⼝包括ARM 过程调⽤标准(APCS)、ARM ELF、ARM DWARF、基础平台ABI(BPABI)、C++ ABI、异常处理ABI、运⾏时ABI和C库ABI。”
在⽂档的Terms and abbreviations中有:
AEABI  (Embedded) ABI for the ARM architecture (this ABI…)
也证实了EABI就是Application Binary Interface for the ARM Architecture
EABI的内容
ABI for the ARM architecture是很多规范的合集:
AADWARF      DWARF for the ARM Architecture
AAELF        ELF for the ARM Architecture
AAPCS        Procedure Call Standard for the ARM Architecture
ADDENDA      Addenda to, and errata in, the ABI for the ARM Architecture
BPABI          Base Platform ABI for the ARM Architecture
BSABI          ABI for the ARM Architecture (Base Standard)
CLIBABI        C Library ABI for the ARM Architecture
CPPABI        C++ ABI for the ARM Architecture
EHABI          Exception Handling ABI for the ARM Architecture
EHEGI          Exception handling component specimen implementations
RTABI            Run-time ABI for the ARM Architecture
EABI的作⽤gnu编译器
EABI的⽬的是使不同的编译器编译出来的⼆进制⽂件可以互相使⽤(interoperability),⽐如Codesourcery, RVCT, RVDS这些编译器。符合EABI标准编译器编译出的库可以相互链接,这样软件开发⼈员就可以混合使⽤不同⼚商提供的符合EABI标准的⼆进制库。
“ARM 有助于 GNU 编译器项⽬,该项⽬跟踪 ARM 体系结构的发展,并确保为 ARM 提供⾼质 GNU ⼯具链。
该⼯具链⽀持⽬前的所有 ARM 体系结构和处理器(包括),并计划⽀持将来的处理器和体系结构。
该⼯具链符合最新的,因此可与或符合 ABI 的任何其他⼯具链交互⼯作。⽤户可以配合使⽤ ARM 提供的商⽤、专业⼯具链的已优化代码⼤⼩与性能以及使⽤开源⼯具⽣成的代码。
当然,EABI相对于以前的ABI性能也会改善。
EABI相对于以前的ABI的改进
Differences between v1 and v2 of the ABI for the ARM Architecture列出了ABI for the ARM Architecture V1和V2两个版本的不同,这⾥的ABI for the ARM Architecture V2就是EABI,V1也被称作Old ABI 或者Lagacy ABI。EABI是2005年推出的,新是相对于以前的“⽼”⽽⾔,从时间上看其实已经很“⽼”了——所以很多这些所谓的“改变”,其实现在已经是标准做法了,例如Exception Handling ABI的改进使浮点数的性能的改善,堆栈的8字节对齐,structure packing的改变等等。
GNU EABI
在很多地⽅有GNU EABI的说法,这是⼀个不同的ABI吗?
还是Codesourcery上的QA:
Question
Why is the configuration name for GNU/Linux arm-none-linux-gnueabi instead of just arm-none-linux-eabi? Is there a GNU variant of the EABI?
Answer
The Free Software Foundation prefers that configuration names for GNU/Linux contain both the string linux and the string gnu. The configuration arm-none-linux-gnu refers to the legacy ARM ABI for GNU/Linux. Some tools depend on the fact that configuration names have at most three hyphens, so gnu and eabi were combined into a single word.
The ABI used on GNU/Linux is not a special GNU variant of the EABI; it is just the EABI.
GNU EABI就是EABI,ABI for the ARM architecture。
相关资料
Debian Wiki: ArmEabiPort
Codesourcery上的ARM架构FAQ
Wikipedia上的ABI
CSDN hongjiujing的总结:ABI/EABI/OABI
EABI对浮点数性能的改善:Why ARM's EABI Matters