-
Install Rust following instructions on this page
-
rustup +nightly component add rust-src
-
rustup +nightly target add riscv64gc-unknown-none-elf
-
cargo install cargo-xbuild
-
cargo +nightly xbuild --release
-
rustup +stable component add llvm-tools-preview
-
cargo install cargo-binutils
then this will work.
rustup run stable rust-objcopy -O binary target/riscv64gc-unknown-none-elf/release/step1-puts step1-puts.text
or you may use gnu binutils' objdump or llvm-objdmp with proper riscv support from your distributyon or elsewhere.
for instance you can find riscv64-unknown-elf toolchain here.
-
link.x includes a few assembler instructions to setup the stack pointer and the program counter.
-
Use rvemu to run the generated codes.