-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation for LLVM CFI support
This commit updates the documentation for the LLVM Control Flow Integrity (CFI) support in the Rust compiler.
- Loading branch information
Showing
2 changed files
with
126 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/doc/unstable-book/src/language-features/cfi-encoding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# `cfi_encoding` | ||
|
||
The tracking issue for this feature is: [#89653] | ||
|
||
[#89653]: https://github.com/rust-lang/rust/issues/89653 | ||
|
||
------------------------ | ||
|
||
The `cfi_encoding` feature allows the user to define a CFI encoding for a type. | ||
It allows the user to use a different names for types that otherwise would be | ||
required to have the same name as used in externally defined C functions. | ||
|
||
## Examples | ||
|
||
```rust | ||
#![feature(cfi_encoding, extern_types)] | ||
|
||
#[cfi_encoding = "3Foo"] | ||
pub struct Type1(i32); | ||
|
||
extern { | ||
#[cfi_encoding = "3Bar"] | ||
type Type2; | ||
} | ||
``` |