Skip to content

Commit 54c528e

Browse files
authored
Rollup merge of #116593 - tgross35:no-jump-tables-docs, r=compiler-errors
Add unstable book page for the no-jump-tables codegen option See tracking issue: #116592
2 parents 19149d1 + 51e8c80 commit 54c528e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# `no-jump-tables`
2+
3+
The tracking issue for this feature is [#116592](https://github.com/rust-lang/rust/issues/116592)
4+
5+
---
6+
7+
This option enables the `-fno-jump-tables` flag for LLVM, which makes the
8+
codegen backend avoid generating jump tables when lowering switches.
9+
10+
This option adds the LLVM `no-jump-tables=true` attribute to every function.
11+
12+
The option can be used to help provide protection against
13+
jump-oriented-programming (JOP) attacks, such as with the linux kernel's [IBT].
14+
15+
```sh
16+
RUSTFLAGS="-Zno-jump-tables" cargo +nightly build -Z build-std
17+
```
18+
19+
[IBT]: https://www.phoronix.com/news/Linux-IBT-By-Default-Tip

0 commit comments

Comments
 (0)