[all-commits] [llvm/llvm-project] 4e3b7d: MC: Introduce R_AARCH64_FUNCINIT64 relocation type.

Peter Collingbourne via All-commits all-commits at lists.llvm.org
Tue Oct 14 10:58:19 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e3b7df47608c02f3b07845bd414a61a991348a7
      https://github.com/llvm/llvm-project/commit/4e3b7df47608c02f3b07845bd414a61a991348a7
  Author: Peter Collingbourne <pcc at google.com>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/ELFRelocs/AArch64.def
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.h
    M llvm/test/MC/AArch64/data-directive-specifier.s

  Log Message:
  -----------
  MC: Introduce R_AARCH64_FUNCINIT64 relocation type.

R_AARCH64_FUNCINIT64 is a dynamic relocation type for relocating
word-sized data in the output file using the return value of
a function. An R_AARCH64_FUNCINIT64 shall be relocated as an
R_AARCH64_IRELATIVE with the target symbol address if the target
symbol is non-preemptible, and it shall be a usage error to relocate an
R_AARCH64_FUNCINIT64 with a preemptible or STT_GNU_IFUNC target symbol.

The initial use case for this relocation type shall be for emitting
global variable field initializers for structure protection. With
structure protection, the relocation value computation is tied to the
compiler implementation in such a way that it would not be reasonable to
define a relocation type for it (for example, it may involve computing
a hash using a compiler-determined algorithm), hence the need for the
computation to be implemented as code in the binary.

Part of the AArch64 psABI extension:
https://github.com/ARM-software/abi-aa/issues/340

Reviewers: smithp35

Reviewed By: smithp35

Pull Request: https://github.com/llvm/llvm-project/pull/133531



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list