[PATCH] D24471: [ELF] Set EF_ARM_EABI_VER5 for ARM

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 03:35:28 PDT 2016


peter.smith added a comment.

Strictly speaking EF_ARM_EABI version It is a bit more than an implementation detail. The current value of 0 is more honest, however it may be less useful in practice.

The EF_ARM_EABI version is defined in http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf

| EF_ARM_ABIMASK (0xFF000000) (current version is 0x05000000) |

This masks an 8-bit version number, the version of the ABI to which this 
ELF file conforms. This ABI is version 5. A value of 0 denotes unknown 
conformance. |

I think the AArch64 kernel isn't being very helpful here as 0 does not necessarily mean < 1, it just means not known. However that isn't lld's problem.

To the question of what should the ABI version be set to:
The ABI version that is put in the executable is a combination of the ABI version of the input files and the changes made by the linker for the output file. For example some aspects of the ABI version are determined by the compiler/assembler, the linker can also use and will set certain flags such as EF_ARM_ABI_FLOAT_HARD that are only defined in a certain ABI version.

In an ideal world we would read the ABI version from the input objects, fault any incompatibilities that we can't handle, use no ARM ELF specific features from the highest ABI version read, and write this version out into the executable. We are quite a long way from doing this in the ARM port so far.

I think the current value of EF_ARM_ABI_VERSION = 0 is honest, as the ARM port is incomplete and we can't make any firm statements of conformance right now. In practice all input objects given to lld will be EF_ARM_ABI_VERSION 5 and we don't make use of any features that are incompatible with EF_ARM_ABI_VERSION 5 so I think it is acceptable to set the default to 5 as long as we leave an appropriate comment.

We aren't in a position to report hard or soft float. We don't support BuildAttributes to get this information from object files and we don't hard-code at build time like GNU ld (arm-linux-gnueabi-hf distribution). In any case EF_ARM_VFP_FLOAT and EF_ARM_SOFT_FLOAT are one of the few changes from ABI version 4 to version 5. The correct terms are EF_ARM_ABI_FLOAT_HARD and EF_ARM_ABI_FLOAT_SOFT in version 5.


https://reviews.llvm.org/D24471





More information about the llvm-commits mailing list