From 2810b1b80341315567e24574267f5dead540f858 Mon Sep 17 00:00:00 2001 From: Christopher Cole Date: Wed, 20 Apr 2016 21:03:18 -0700 Subject: [PATCH] Move rust-readelf out into its own package --- Cargo.toml | 3 --- src/bin/rust-readelf.rs | 34 ---------------------------------- 2 files changed, 37 deletions(-) delete mode 100644 src/bin/rust-readelf.rs diff --git a/Cargo.toml b/Cargo.toml index 39e3a85..35060c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,6 @@ description = "A pure-rust library for parsing ELF files" keywords = ["elf"] readme = "README.md" -[[bin]] -name = "rust-readelf" - [lib] name = "elf" diff --git a/src/bin/rust-readelf.rs b/src/bin/rust-readelf.rs deleted file mode 100644 index 3786e4c..0000000 --- a/src/bin/rust-readelf.rs +++ /dev/null @@ -1,34 +0,0 @@ -extern crate elf; - -use std::env; -use std::path::PathBuf; - -fn main() { - let args: Vec = env::args().collect(); - let paths: Vec = if args.len() == 1 { - vec!(From::from("stress")) - } else { - let mut i = args.into_iter(); - i.next(); - i.map(|arg| From::from(arg) ) - .collect() - }; - for path in paths.into_iter() { - let file = match elf::File::open_path(&path) { - Ok(f) => f, - Err(e) => panic!("Error: {:?}", e), - }; - println!("Debug-print ELF file:"); - println!("{:?}", file); - println!(""); - println!("Pretty-print ELF file:"); - println!("{}", file); - - println!("Getting the .text section"); - let text = file.get_section(".text"); - match text { - Some(s) => println!("shdr: {}", s), - None => println!("Failed to look up .text section!"), - } - } -}