Skip to content

Commit

Permalink
Rollup merge of rust-lang#62281 - Disasm:riscv-pic, r=nagisa
Browse files Browse the repository at this point in the history
Add support for pc-relative addressing on 64-bit RISC-V

These changes allow Rust to generate position-independent code on `riscv64` targets with code model `medium`.

Closes: rust-lang#59802
See also: rust-embedded/riscv-rt#25, rust-embedded/wg#218
  • Loading branch information
Centril committed Jul 6, 2019
2 parents fe3855c + c65ffa7 commit 5c6b58e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: "static".to_string(),
code_model: Some("medium".to_string()),
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
eliminate_frame_pointer: false,
Expand Down
1 change: 1 addition & 0 deletions src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub fn target() -> TargetResult {
executables: true,
panic_strategy: PanicStrategy::Abort,
relocation_model: "static".to_string(),
code_model: Some("medium".to_string()),
emit_debug_gdb_scripts: false,
abi_blacklist: super::riscv_base::abi_blacklist(),
eliminate_frame_pointer: false,
Expand Down

0 comments on commit 5c6b58e

Please sign in to comment.