diff options
author | PiJoules <6019989+PiJoules@users.noreply.github.com> | 2025-06-04 11:19:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-04 11:19:26 -0700 |
commit | b194cf1e401a9c7293c1e9b7d30008fad6b53ede (patch) | |
tree | ac619a9c2b37ea8bf9295e80dd98aed2235a708b /llvm/lib/Bitcode | |
parent | f32f048719455b4813ff7115e4f3a6cdc65efff0 (diff) | |
download | llvm-b194cf1e401a9c7293c1e9b7d30008fad6b53ede.zip llvm-b194cf1e401a9c7293c1e9b7d30008fad6b53ede.tar.gz llvm-b194cf1e401a9c7293c1e9b7d30008fad6b53ede.tar.bz2 |
[clang] Function type attribute to prevent CFI instrumentation (#135836)
This introduces the attribute discussed in
https://discourse.llvm.org/t/rfc-function-type-attribute-to-prevent-cfi-instrumentation/85458.
The proposed name has been changed from `no_cfi` to
`cfi_unchecked_callee` to help differentiate from `no_sanitize("cfi")`
more easily. The proposed attribute has the following semantics:
1. Indirect calls to a function type with this attribute will not be
instrumented with CFI. That is, the indirect call will not be checked.
Note that this only changes the behavior for indirect calls on pointers
to function types having this attribute. It does not prevent all
indirect function calls for a given type from being checked.
2. All direct references to a function whose type has this attribute
will always reference the true function definition rather than an entry
in the CFI jump table.
3. When a pointer to a function with this attribute is implicitly cast
to a pointer to a function without this attribute, the compiler will
give a warning saying this attribute is discarded. This warning can be
silenced with an explicit C-style cast or C++ static_cast.
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions