[RFC] AArch64 Build Attributes for ELF relocatable objects

Arm are proposing to use Build Attributes to store metadata in ELF relocatable object files. We welcome any community feedback on the draft ABI specification AArch64 build attributes specification by smithp35 · Pull Request #230 · ARM-software/abi-aa · GitHub

Many targets have means to add metadata to relocatable object that can be used by a static linker to diagnose incompatible ABI variants and set metadata in executables/shared-libraries that aggregate the metadata from the input objects.

AArch64 has, so far, made limited use of .note.GNU.property sections in relocatable objects and executables/shared-libraries to recored use of Pointer Authentication and more importantly compatibility with the branch target identification (BTI) mechanism.

Arm is exploring the use of Build Attributes for metadata in ELF relocatable objects instead of .note.GNU.property sections. The use of .note.GNU.property for executables and shared libraries will continue, as will support for the existing .note.GNU.property sections defined in [1].

AArch64 Build Attributes in the implementation will be very similar to AArch32 (ARM Target) Build Attributes [2]. I believe RISCV has a similar concept although I’m not familiar with the details.

The ABI has already reserved a section [3] for Build Attributes.

If Build Attributes are adopted by the AArch64 ABI, this will have the following impact on the llvm-project:

  • An implementation of Build Attributes for AArch64. A lot of the code for AArch32 build-attributes can be reused.
  • Assembler directives to create Build Attributes, similar to the existing ARM .eabi_attribute directive, as well as compiler/assembler options to infer the build-attributes from the command line options.
  • LLD processing of Build Attributes sections similar to the ARM target.

If the proposal is adopted Arm will develop the implementation as part of the next feature that requires relocatable object metadata. There will also be an imple\menation in the GNU toolchain.

The draft ABI specification can be found in the Arm ABI Github project at AArch64 build attributes specification by smithp35 · Pull Request #230 · ARM-software/abi-aa · GitHub
This includes a draft specification and a design rationale document.

If you have any feedback, ideally please comment on the pull request above. Comments on this discourse post are also welcome.

[1] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst
[2] https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst#addendum-build-attributes
[3] https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst#build-attributes

5 Likes