[PATCH] D104759: Indicate ABI in ARM ELF header flags

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 08:08:08 PDT 2021


peter.smith added a comment.

Sorry I think that we shouldn't be setting these flags at all in relocatable objects.

If you look at the definition for these flags in https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#52elf-header they are defined for executables only for example:

  Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note that the executable file was built to conform to the hardware floating-point procedure-call standard.
  
  Compatible with legacy (pre version 5) gcc use as EF_ARM_VFP_FLOAT.

A linker is expected to derive these values from Tag_ABI_VFP_args see https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst

  Tag_ABI_VFP_args, (=28), uleb128
      0  The user intended FP parameter/result passing to conform to AAPCS, base variant
      1  The user intended FP parameter/result passing to conform to AAPCS, VFP variant
      2  The user intended FP parameter/result passing to conform to tool chain-specific
         conventions
      3  Code is compatible with both the base and VFP variants; the user did not permit
         non-variadic functions to pass FP parameters/results

You can see this by compiling an object with GCC, there is no ELF flag set for EF_ARM_ABI_FLOAT_HARD, the linker will add it in based on the build attributes.
See https://github.com/llvm/llvm-project/blob/main/lld/ELF/InputFiles.cpp#L699 in LLD for similar logic.

The BuildAttributes can be set directly by the user with .eabi_attribute directive. I believe the compiler should set them automatically and the assembler might be able to set them based on the target. I'd check there if there is a problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104759/new/

https://reviews.llvm.org/D104759



More information about the llvm-commits mailing list