diff --git a/Cargo.toml b/Cargo.toml index 4dc26b4..1516939 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "vdso" version = "0.2.2" authors = ["Nathaniel McCallum "] edition = "2021" -rust-version = "1.56" +rust-version = "1.65" license = "Apache-2.0" homepage = "https://github.com/enarx/vdso" repository = "https://github.com/enarx/vdso" @@ -28,4 +28,4 @@ libc = "0.2.67" [dependencies] crt0stack = "0.1" -goblin = "0.6.0" +goblin = "0.8.0" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7874ce5..76a544a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.56" +channel = "1.65" profile = "minimal" diff --git a/src/lib.rs b/src/lib.rs index 4dbca93..e62e256 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,7 @@ use std::os::raw::c_char; use std::slice::from_raw_parts; #[cfg(target_pointer_width = "64")] +#[allow(unused_imports)] mod elf { pub use goblin::elf64::dynamic::*; pub use goblin::elf64::header::*; @@ -23,6 +24,7 @@ mod elf { } #[cfg(target_pointer_width = "32")] +#[allow(unused_imports)] mod elf { pub use goblin::elf32::dynamic::*; pub use goblin::elf32::header::*; @@ -82,7 +84,7 @@ impl Header { let symstrtab: &[c_char] = self.section(elf::SHT_STRTAB)?; let symtab: &[elf::Sym] = self.section(elf::SHT_DYNSYM)?; - // Yes, we could spead up the lookup by checking against the hash + // Yes, we could speed up the lookup by checking against the hash // table. But the reality is that there is less than a dozen symbols // in the vDSO, so the gains are trivial. @@ -90,7 +92,7 @@ impl Header { let cstr = CStr::from_ptr(&symstrtab[sym.st_name as usize]); if let Ok(s) = cstr.to_str() { if s == name { - let addr = self.ptr(sym.st_value) as *const Symbol; + let addr = self.ptr(sym.st_value); return Some(&*addr); } }