[all-commits] [llvm/llvm-project] edf213: [AArch64][v8.5A] Omit BTI for non-addr-taken stati...

Simon Tatham via All-commits all-commits at lists.llvm.org
Thu Apr 10 09:09:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: edf21314c98a4fe05d48f83dfab2b201ed8bfe9c
      https://github.com/llvm/llvm-project/commit/edf21314c98a4fe05d48f83dfab2b201ed8bfe9c
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2025-04-10 (Thu, 10 Apr 2025)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64BranchTargets.cpp
    A llvm/test/CodeGen/AArch64/bti-linkage.ll
    M llvm/test/CodeGen/AArch64/patchable-function-entry-bti.ll

  Log Message:
  -----------
  [AArch64][v8.5A] Omit BTI for non-addr-taken static fns in ELF (#135043)

This follows up commit 7af2b51e761f499, which removed the BTI at the
start of functions with internal linkage (provided they weren't
indirectly called inside the translation unit) for Linux targets.

Now we leave out the BTI for any ELF target, including bare-metal,
because the AAELF64 document in the Arm ABI has been updated to make the
same guarantee as SYSVABI64: if the linker wants to insert an indirect
branch at link time (e.g. as part of a long branch thunk) it's
responsible for making a BTI-equipped landing pad.

That was too difficult to test in the existing codegen test
`patchable-function-entry-bti.ll`, because so much of LLVM's detailed
asm output changes for non-ELF targets. So I've simplified that back to
how it was before 7af2b51e761f499 (except that now it expects no BTI in
the disputed function), and made a new test checking specifically the
difference in BTI between the formats.



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