[all-commits] [llvm/llvm-project] ab81f4: [AArch64][PAC] Handle signing of init/fini pointer...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Mon Jul 13 09:39:02 PDT 2026


  Branch: refs/heads/users/atrosinenko/pauth-init-fini
  Home:   https://github.com/llvm/llvm-project
  Commit: ab81f41c0f6721f004ea7fc678a72d602f2003bc
      https://github.com/llvm/llvm-project/commit/ab81f41c0f6721f004ea7fc678a72d602f2003bc
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M clang/include/clang/Basic/PointerAuthOptions.h
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/test/CodeGen/ptrauth-init-fini.c
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/Target/AArch64/AArch64PointerAuth.h
    A llvm/test/CodeGen/AArch64/ptrauth-init-fini-autoupgrade.ll
    M llvm/test/CodeGen/AArch64/ptrauth-init-fini.ll

  Log Message:
  -----------
  [AArch64][PAC] Handle signing of init/fini pointers in AsmPrinter

Move signing of the contents of `@llvm.global_(ctors|dtors)` from
Clang frontend to the end of the backend pipeline, to AsmPrinter.

Signing of the pointers to init/fini functions in the backend fixes
registration of the constructors and destructors performed by the
optimizer or the backend.

This commit introduces two new module flags, `ptrauth-init-fini` and
`ptrauth-init-fini-address-discrimination`, mirroring corresponding
Clang options. The flags are semantically boolean, and the module
is allowed to have either none of these flags, only the first one,
or both. The particular constant discriminator to use is not
configurable via module flags and is hardcoded to the value 0xD9D4
in the `llvm/lib/Target/AArch64/AArch64PointerAuth.h` file.


  Commit: 340a4c4ec0bdc3c5644ad2acc757ee242a568a7c
      https://github.com/llvm/llvm-project/commit/340a4c4ec0bdc3c5644ad2acc757ee242a568a7c
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M llvm/lib/IR/AutoUpgrade.cpp

  Log Message:
  -----------
  Improve readability


  Commit: 26731e47bb402cfd2762e4b56f86d036a952b6ef
      https://github.com/llvm/llvm-project/commit/26731e47bb402cfd2762e4b56f86d036a952b6ef
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/test/CodeGen/AArch64/ptrauth-init-fini-autoupgrade.ll

  Log Message:
  -----------
  Fix module flag name spelling in AutoUpgrade.cpp


  Commit: d0b4baee9400728fe1249b682d9803cd26401f71
      https://github.com/llvm/llvm-project/commit/d0b4baee9400728fe1249b682d9803cd26401f71
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-07-13 (Mon, 13 Jul 2026)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGen/ptrauth-init-fini.c
    M clang/test/CodeGen/ptrauth-module-flags.c
    M clang/test/CodeGenCXX/pfp-memcpy.cpp
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/test/CodeGen/AArch64/ptrauth-init-fini-autoupgrade.ll
    M llvm/test/CodeGen/AArch64/ptrauth-init-fini.ll

  Log Message:
  -----------
  Switch to unconditionally-set module flags


Compare: https://github.com/llvm/llvm-project/compare/b553fccb117f...d0b4baee9400

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