Skip to content

Commit 59187f9

Browse files
committed
rustc-book: Document -C code-model
1 parent 55a94bd commit 59187f9

File tree

1 file changed

+18
-2
lines changed
  • src/doc/rustc/src/codegen-options

1 file changed

+18
-2
lines changed

src/doc/rustc/src/codegen-options/index.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,25 @@ This option is deprecated and does nothing.
99

1010
## code-model
1111

12-
This option lets you choose which code model to use.
12+
This option lets you choose which code model to use. \
13+
Code models put constraints on address ranges that the program and its symbols may use. \
14+
With smaller address ranges machine instructions
15+
may be able to use use more compact addressing modes.
1316

14-
To find the valid options for this flag, run `rustc --print code-models`.
17+
The specific ranges depend on target architectures and addressing modes available to them. \
18+
For x86 more detailed description of its code models can be found in
19+
[System V Application Binary Interface](https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf)
20+
specification.
21+
22+
Supported values for this option are:
23+
24+
<!-- - `tiny` - Tiny code model. -->
25+
- `small` - Small code model. This is the default model for majority of supported targets.
26+
- `kernel` - Kernel code model.
27+
- `medium` - Medium code model.
28+
- `large` - Large code model.
29+
30+
Supported values can also be discovered by running `rustc --print code-models`.
1531

1632
## codegen-units
1733

0 commit comments

Comments
 (0)