Skip to content

Commit da20827

Browse files
tclin914cmuellner
authored andcommitted
Add large code model
Signed-off-by: Jim Tsung-Chun Lin <[email protected]>
1 parent 9423bf0 commit da20827

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/toolchain-conventions.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ within a single 2GiB address range, between the absolute addresses -2GiB and
108108
- `-mcmodel=medany`. The program and its statically defined symbols must lie
109109
within a single 4GiB address range. `auipc` and `addi` pairs are used to
110110
generate addresses.
111+
- `-mcmodel=large`. The program and its statically defined symbols can lie
112+
within the whole 64-bit address range. `auipc`, `addi` and `ld` are used to
113+
generate addresses.
111114
- Use of any PIC or PIE option (e.g. -fpic, -fPIC, -fpie or -fPIE) will enable
112115
the medium position independent code model. This model is similar to the medium
113116
any code model, but uses the global offset table (GOT) for non-local symbol
@@ -119,6 +122,7 @@ RISC-V psABI has a contain sections to describe the code model:
119122

120123
- https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#medium-low-code-model[Medium low code model]: -mcmodel=medlow
121124
- https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#medium-any-code-model[Medium any code model]: -mcmodel=medany
125+
- https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#large-code-model[Large code model]: -mcmodel=large
122126
- https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#medium-position-independent-code-model[Medium position independent code model]: -fpic, -fPIC, -fpie or -fPIE.
123127

124128
== Disassembler (objdump) behaviour
@@ -172,8 +176,9 @@ toolchain defined `+__riscv__+`.
172176
- `+__riscv_float_abi_soft+`, `+__riscv_float_abi_single+`,
173177
`+__riscv_float_abi_double+`: one of these three will be defined, depending on
174178
target ABI.
175-
- `+__riscv_cmodel_medlow+`, `+__riscv_cmodel_medany+`: one of these two will be
176-
defined, depending on the target code model.
179+
- `+__riscv_cmodel_medlow+`, `+__riscv_cmodel_medany+`,
180+
`+__riscv_cmodel_large+`: one of these three will be defined, depending on
181+
the target code model.
177182
- `+__riscv_mul+`: defined when targeting the 'M' ISA extension.
178183
- `+__riscv_muldiv+`: defined when targeting the 'M' ISA extension and
179184
`-mno-div` has not been used.

0 commit comments

Comments
 (0)