rCore

Based on rCore-Tutorial-Guide 2023 春季学期 and rCore-Tutorial-Book 第三版

Useful Command

To show platforms based on RISC-V that rustc supports

1
rustc --print target-list | grep riscv

Rust Note

Cross Build (RISC-V)

.cargo/.config

[build]
target = "riscv64gc-unknown-none-elf"

Notes

Linker Script

linker script specifications: info ld Scripts or you can read in Emacs(C-h i)

Toolings

  1. strace
  2. file show file format
  3. stat show file/directory status (and size & blocks & Inode & … information)
  4. readelf ELF file information readelf -W -S <executable> show all the sections of a executable (for instance, `.text`, `.data`) (rust-readobj --section-headers <executable> can also show sections header information of a executable)
  5. cargo-binutils analysis binary installation:

    1
    2
    
    cargo install cargo-binutils
    rustup component add llvm-tools-preview
    1. show the heading information of a executable file rust-readobj -h <executable>
    2. reverse engineering of a executable file rust-objdump -S <executable>