Elfloader library for the Rust programming language.
This library is going to help you load .o file into your system and make you easier to use the global functions and data in this ELF file.
1. rustup override set nightly
2. cargo -Z build-std=core,alloc build [--release]OR
cargo build [--release]We can just simply use cargo build [--release] because of rust-toolchain and .cargo/config.toml, then C-compatible static library libelfloader.a will be generated in directory target/<arch>/[debug|release] and I have also offered the C header file in include for detail.
- load
elf headerandsection headersinto memory for Analyze - get section
sizeandalignmentinformation fromsection headersfor Allocation - calculate the required
sizeandalign, and then Allocate memories - load
.text,.data,.bss,.rodatasection into memory - load
symtabthroughsection headerand Resolve all symbols' value - read
relataband then Relocate symbols which in target section - now the code can be executed normaly