[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)
Kees Cook via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 15 22:06:39 PDT 2025
================
@@ -0,0 +1,190 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -x c++ -o - %s | FileCheck %s --check-prefixes=CHECK,MEMBER
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -fpatchable-function-entry-offset=3 -o - %s | FileCheck %s --check-prefixes=CHECK,OFFSET
+
+// Note that the interleving of functions, which normally would be in sequence,
+// is due to the fact that Clang outputs them in a non-sequential order.
+
+#if !__has_feature(kcfi)
----------------
kees wrote:
The prototype mismatch at assignment type is a really good question. I hadn't considered this at all, but yes, it would really be a nice addition to catch misuse at build time. Is it complex to add?
https://github.com/llvm/llvm-project/pull/141846
More information about the cfe-commits
mailing list