[PATCH] D49993: [LLD][ELF][ARM] Implement support for Tag_ABI_VFP_args

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 09:20:19 PDT 2018


peter.smith created this revision.
peter.smith added reviewers: ruiu, grimar.
Herald added a reviewer: javed.absar.
Herald added subscribers: chrib, kristof.beyls, arichardson.
Herald added a reviewer: espindola.

The Tag_ABI_VFP_args build attribute controls the procedure call standard used for floating point parameters on ARM. The values are:

  0 - Base AAPCS (FP Parameters passed in Core (Integer) registers
  1 - VFP AAPCS (FP Parameters passed in FP registers)
  2 - Toolchain specific (Neither Base or VFP)
  3 - Compatible with all (No use of floating point parameters)

If the Tag_ABI_VFP_args build attribute is missing it has an implicit value of 0.

We use the attribute in two ways:

- Detect a clash in calling convention between Base, VFP and Toolchain. We follow ld.bfd's lead and do not error if there is a clash between an implicit Base AAPCS caused by a missing attribute. Many projects including the hard-float (VFP AAPCS) version of glibc contain assembler files that do not use floating point but do not have Tag_ABI_VFP_args.
- Set the EF_ARM_ABI_FLOAT_SOFT or EF_ARM_ABI_FLOAT_HARD ELF header flag for Base or VFP AAPCS respectively. This flag is used by some ELF loaders.

The patch is based on the patch posted by Mark Kettenis to llvm-dev http://lists.llvm.org/pipermail/llvm-dev/2018-July/124876.html . It is dependent on https://reviews.llvm.org/D49992 to add the EF_ARM_ABI_FLOAT_SOFT and EF_ARM_ABI_FLOAT_HARD ELF header flags.

References:

- Addenda to, and Errata in, the ABI for the ARM Architecture for Tag_ABI_VFP_args http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045e/IHI0045E_ABI_addenda.pdf
- Elf for the ARM Architecture for ELF header flags http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf

Fixes PR36009 (https://bugs.llvm.org/show_bug.cgi?id=36009)


https://reviews.llvm.org/D49993

Files:
  ELF/Arch/ARM.cpp
  ELF/Config.h
  ELF/InputFiles.cpp
  test/ELF/Inputs/arm-vfp-arg-base.s
  test/ELF/Inputs/arm-vfp-arg-compat.s
  test/ELF/Inputs/arm-vfp-arg-toolchain.s
  test/ELF/Inputs/arm-vfp-arg-vfp.s
  test/ELF/arm-eabi-version.s
  test/ELF/arm-tag-vfp-args-errs.s
  test/ELF/arm-tag-vfp-args.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49993.157982.patch
Type: text/x-patch
Size: 11173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180730/1dc9386c/attachment.bin>


More information about the llvm-commits mailing list