File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/doc/unstable-book/src/compiler-flags Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments