Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/toolchain-conventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ within a single 2GiB address range, between the absolute addresses -2GiB and
- `-mcmodel=medany`. The program and its statically defined symbols must lie
within a single 4GiB address range. `auipc` and `addi` pairs are used to
generate addresses.
- `-mcmodel=large`. The program and its statically defined symbols can lie
within the whole 64-bit address range. `auipc`, `addi` and `ld` are used to
generate addresses.
- Use of any PIC or PIE option (e.g. -fpic, -fPIC, -fpie or -fPIE) will enable
the medium position independent code model. This model is similar to the medium
any code model, but uses the global offset table (GOT) for non-local symbol
Expand All @@ -119,6 +122,7 @@ RISC-V psABI has a contain sections to describe the code model:

- 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
- 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
- https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#large-code-model[Large code model]: -mcmodel=large
- 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.

== Disassembler (objdump) behaviour
Expand Down Expand Up @@ -172,8 +176,9 @@ toolchain defined `+__riscv__+`.
- `+__riscv_float_abi_soft+`, `+__riscv_float_abi_single+`,
`+__riscv_float_abi_double+`: one of these three will be defined, depending on
target ABI.
- `+__riscv_cmodel_medlow+`, `+__riscv_cmodel_medany+`: one of these two will be
defined, depending on the target code model.
- `+__riscv_cmodel_medlow+`, `+__riscv_cmodel_medany+`,
`+__riscv_cmodel_large+`: one of these three will be defined, depending on
the target code model.
- `+__riscv_mul+`: defined when targeting the 'M' ISA extension.
- `+__riscv_muldiv+`: defined when targeting the 'M' ISA extension and
`-mno-div` has not been used.
Expand Down