You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
580 B
Rust
27 lines
580 B
Rust
use crate::common::{Lazy, Symbol};
|
|
use crate::error::Error;
|
|
use crate::linker::Linker;
|
|
use xmas_elf::ElfFile;
|
|
|
|
mod object;
|
|
|
|
pub use object::XElfObject;
|
|
|
|
impl Linker<'_> {
|
|
// shortcut to avoid turbofish
|
|
pub fn xelf() -> Self {
|
|
Self::new(Vec::new())
|
|
}
|
|
}
|
|
|
|
impl<'data> Lazy<&'data str, ElfFile<'data>> for Symbol<'data> {
|
|
fn value(&self, src: &ElfFile<'data>) -> Result<&'data str, Error> {
|
|
src.get_string(self.index)
|
|
.map_err(|e| Error::MissingSectionData(e))
|
|
}
|
|
|
|
fn resolved(&self) -> bool {
|
|
self.str_ref.is_some()
|
|
}
|
|
}
|