From 6e61c5402d944f0f8bb9a339484f1d6dbc1b7c90 Mon Sep 17 00:00:00 2001 From: pjht Date: Wed, 16 Nov 2022 10:40:26 -0600 Subject: [PATCH] Update crates and upgrade to elf v0.7 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/symbol_table.rs | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3886038..3987847 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,9 +239,9 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elf" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c09b5bbd5d4c1318fd4825d697b8117506fc36ab9680bdd792f65a2acbdf1ed" +checksum = "6de42b0529467fc9a2692fd91585c84dd255fb15b0df0f80299724a9456986c6" [[package]] name = "errno" @@ -1032,9 +1032,9 @@ checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "wyz" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] diff --git a/Cargo.toml b/Cargo.toml index 2119891..5b6d5a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" anyhow = "1.0.66" bitvec = "1.0.0" derive-try-from-primitive = "1.0.0" -elf = "0.6.0" +elf = "0.7.0" human-repr = { version = "1.0.1", features = ["iec", "space"] } indexmap = "1.9.1" inventory = "0.3.1" diff --git a/src/symbol_table.rs b/src/symbol_table.rs index 7e57ddb..d78cef7 100644 --- a/src/symbol_table.rs +++ b/src/symbol_table.rs @@ -1,7 +1,8 @@ use crate::symbol::Symbol; use anyhow::anyhow; -use elf::gabi::{STT_FILE, STT_SECTION}; -use elf::CachedReadBytes; +use elf::abi::{STT_FILE, STT_SECTION}; +use elf::endian::AnyEndian; +use elf::ElfStream; use indexmap::IndexSet; use itertools::Itertools; use std::collections::HashMap; @@ -58,7 +59,7 @@ impl SymbolTable { } pub fn read_from_file(path: &str) -> anyhow::Result { - let mut file = elf::File::open_stream(CachedReadBytes::new(File::open(path)?))?; + let mut file = ElfStream::::open_stream(File::open(path)?)?; let (symtab, symstrtab) = file .symbol_table()? .ok_or_else(|| anyhow!("No symbol table in {}", path))?;