We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 19149d1 + 51e8c80 commit 54c528eCopy full SHA for 54c528e
src/doc/unstable-book/src/compiler-flags/no-jump-tables.md
@@ -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