[all-commits] [llvm/llvm-project] 562605: ThinLTOBitcodeWriter: Emit __cfi_check to full LTO...

Peter Collingbourne via All-commits all-commits at lists.llvm.org
Wed Sep 3 03:07:50 PDT 2025


  Branch: refs/heads/release/21.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 562605cef22a2dd9ce1fbdf34642fd471702fc74
      https://github.com/llvm/llvm-project/commit/562605cef22a2dd9ce1fbdf34642fd471702fc74
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2025-09-03 (Wed, 03 Sep 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
    A llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-check.ll

  Log Message:
  -----------
  ThinLTOBitcodeWriter: Emit __cfi_check to full LTO part of bitcode file.

The CrossDSOCFI pass runs on the full LTO module and fills in the
body of __cfi_check. This function must have the correct attributes in
order to be compatible with the rest of the program. For example, when
building with -mbranch-protection=standard, the function must have the
branch-target-enforcement attribute, which is normally added by Clang.
When __cfi_check is missing, CrossDSOCFI will give it the default set
of attributes, which are likely incorrect. Therefore, emit __cfi_check
to the full LTO part, where CrossDSOCFI will see it.

Reviewers: efriedma-quic, vitalybuka, fmayer

Reviewed By: efriedma-quic

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

(cherry picked from commit ff85dbdf6b399eac7bffa13e579f0f5e6edac3c0)



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