pub struct ElfMetadata {Show 15 fields
pub path: PathBuf,
pub architecture: Architecture,
pub e_machine: u16,
pub object_type: ObjectType,
pub interpreter: Option<PathBuf>,
pub needed: Vec<String>,
pub soname: Option<String>,
pub rpath: Vec<String>,
pub runpath: Vec<String>,
pub has_runpath: bool,
pub nodeflib: bool,
pub origin_flag: bool,
pub is_dynamic: bool,
pub dlopen_references: Vec<String>,
pub size: u64,
}Expand description
Everything elfpak needs to know about a single ELF object.
Fields§
§path: PathBufPath the metadata was read from (host path, not logical rootfs path).
architecture: Architecture§e_machine: u16Raw e_machine, kept so diagnostics can name what was actually found
even for architectures Machine does not model.
object_type: ObjectType§interpreter: Option<PathBuf>§needed: Vec<String>§soname: Option<String>§rpath: Vec<String>§runpath: Vec<String>§has_runpath: boolWhether the object has a DT_RUNPATH tag, even if its value is empty.
nodeflib: boolDF_1_NODEFLIB: skip default library search directories.
origin_flag: boolDF_1_ORIGIN / DF_ORIGIN: object expects $ORIGIN processing.
is_dynamic: bool§dlopen_references: Vec<String>References to dlopen-family functions, which static analysis cannot follow.
size: u64Implementations§
Source§impl ElfMetadata
impl ElfMetadata
pub fn parse_file(path: &Path) -> Result<ElfMetadata>
Sourcepub fn looks_like_elf(bytes: &[u8]) -> bool
pub fn looks_like_elf(bytes: &[u8]) -> bool
Cheap check used to decide whether a candidate file is worth parsing.
pub fn parse_bytes(path: &Path, bytes: &[u8]) -> Result<ElfMetadata>
Effective search list contributed by this object: DT_RUNPATH wins over
DT_RPATH, exactly like the glibc loader.
Trait Implementations§
Source§impl Clone for ElfMetadata
impl Clone for ElfMetadata
Source§fn clone(&self) -> ElfMetadata
fn clone(&self) -> ElfMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ElfMetadata
impl RefUnwindSafe for ElfMetadata
impl Send for ElfMetadata
impl Sync for ElfMetadata
impl Unpin for ElfMetadata
impl UnsafeUnpin for ElfMetadata
impl UnwindSafe for ElfMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more