aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2022-04-29 00:10:58 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2022-04-29 00:10:58 +0200
commitc182df75df01d46b7f40de880942ab09c9421fd3 (patch)
tree30ba5e2f5adc32c827e41d1afbbe23e5edafe9c8 /examples
parent15f13f74b67a8d46d8429d7f53128a167c84eebd (diff)
downloadelfload-c182df75df01d46b7f40de880942ab09c9421fd3.tar.gz
elfload-c182df75df01d46b7f40de880942ab09c9421fd3.zip
make crate no_std compatible
Diffstat (limited to 'examples')
-rw-r--r--examples/ls.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/ls.rs b/examples/ls.rs
index 94da7e8..0409ae2 100644
--- a/examples/ls.rs
+++ b/examples/ls.rs
@@ -3,10 +3,14 @@ use elfload::Elf;
fn main() {
let ls_bytes = include_bytes!("/bin/ls");
- match Elf::parse(ls_bytes) {
+ match Elf::<4>::parse(ls_bytes) {
Ok(elf) => {
- println!("ELF machine: {:?} entry: 0x{:08x}", elf.machine, elf.entry);
- for l in &elf.load_segments {
+ println!(
+ "ELF machine: {:?} entry: 0x{:08x}",
+ elf.machine(),
+ elf.entry()
+ );
+ for l in elf.load_segments() {
println!(
"LOAD: vaddr: 0x{:08x} zero_pad: {:8} {}{}{}",
l.vaddr,