Lines Matching refs:elf
8 use elf::{endian::AnyEndian, file::FileHeader, segment::ProgramHeader};
57 if ehdr.class != elf::file::Class::ELF64 { in probe_x86_64()
130 if p_flags & elf::abi::PF_R != 0 { in make_prot()
133 if p_flags & elf::abi::PF_W != 0 { in make_prot()
136 if p_flags & elf::abi::PF_X != 0 { in make_prot()
346 ehdr: &elf::file::FileHeader<AnyEndian>, in create_auxv()
369 fn parse_ehdr(data: &[u8]) -> Result<FileHeader<AnyEndian>, elf::ParseError> { in parse_ehdr()
370 let ident_buf = data.get_bytes(0..elf::abi::EI_NIDENT)?; in parse_ehdr()
371 let ident = elf::file::parse_ident::<AnyEndian>(ident_buf)?; in parse_ehdr()
373 let tail_start = elf::abi::EI_NIDENT; in parse_ehdr()
375 elf::file::Class::ELF32 => tail_start + elf::file::ELF32_EHDR_TAILSIZE, in parse_ehdr()
376 elf::file::Class::ELF64 => tail_start + elf::file::ELF64_EHDR_TAILSIZE, in parse_ehdr()
400 ) -> Result<Option<elf::segment::SegmentTable<'a, AnyEndian>>, elf::ParseError> { in parse_segments()
410 if phnum == elf::abi::PN_XNUM as usize { in parse_segments()
415 .map_err(|_| elf::ParseError::BadOffset(shoff as u64))?; in parse_segments()
419 .map_err(|_| elf::ParseError::BadOffset(shoff as u64))?; in parse_segments()
422 let shdr0 = <elf::section::SectionHeader as elf::parse::ParseAt>::parse_at( in parse_segments()
432 let entsize = <ProgramHeader as elf::parse::ParseAt>::validate_entsize( in parse_segments()
439 .ok_or(elf::ParseError::IntegerOverflow)?; in parse_segments()
442 .ok_or(elf::ParseError::IntegerOverflow)?; in parse_segments()
447 .map_err(|_| elf::ParseError::BadOffset(phoff as u64))?; in parse_segments()
455 return Ok(Some(elf::segment::SegmentTable::new( in parse_segments()
505 .filter(|seg| seg.p_type == elf::abi::PT_LOAD); in load()
617 if (seg_to_load.p_flags & elf::abi::PF_X) != 0 { in load()
649 if ((seg_to_load.p_flags & elf::abi::PF_X) != 0) in load()
773 fn get_bytes(self, range: Range<usize>) -> Result<&'data [u8], elf::ParseError>; in get_bytes()
776 fn get_bytes(self, range: Range<usize>) -> Result<&'data [u8], elf::ParseError> { in get_bytes()
780 .ok_or(elf::ParseError::SliceReadError((start, end))) in get_bytes()