Lines Matching refs:bytes
13 mut bytes: Vec<u8>, in create_gdbjit_image()
16 let e = ensure_supported_elf_format(&bytes)?; in create_gdbjit_image()
19 relocate_dwarf_sections(&mut bytes, code_region)?; in create_gdbjit_image()
24 convert_object_elf_to_loadable_file::<LittleEndian>(&mut bytes, code_region) in create_gdbjit_image()
27 convert_object_elf_to_loadable_file::<BigEndian>(&mut bytes, code_region) in create_gdbjit_image()
31 Ok(bytes) in create_gdbjit_image()
34 fn relocate_dwarf_sections(bytes: &mut [u8], code_region: (*const u8, usize)) -> Result<(), Error> { in relocate_dwarf_sections()
36 let obj = File::parse(&bytes[..]).map_err(obj::ObjectCrateErrorWrapper)?; in relocate_dwarf_sections()
70 .and_then(|offset| object::from_bytes_mut::<U64<NE>>(&mut bytes[offset..]).ok()) in relocate_dwarf_sections()
77 fn ensure_supported_elf_format(bytes: &[u8]) -> Result<Endianness, Error> { in ensure_supported_elf_format()
81 let kind = match object::FileKind::parse(bytes) { in ensure_supported_elf_format()
88 object::FileKind::Elf64 => match object::elf::FileHeader64::<Endianness>::parse(bytes) { in ensure_supported_elf_format()
123 bytes: &mut Vec<u8>, in convert_object_elf_to_loadable_file()
128 let header = FileHeader64::<E>::parse(&bytes[..]).unwrap(); in convert_object_elf_to_loadable_file()
129 let sections = header.sections(e, &bytes[..]).unwrap(); in convert_object_elf_to_loadable_file()
137 object::from_bytes_mut(&mut bytes[off..]).unwrap().0; in convert_object_elf_to_loadable_file()
146 let ph_off = bytes.len(); in convert_object_elf_to_loadable_file()
149 bytes.resize(ph_off + e_phentsize * e_phnum, 0); in convert_object_elf_to_loadable_file()
153 object::from_bytes_mut(&mut bytes[ph_off..]).unwrap().0; in convert_object_elf_to_loadable_file()
165 let header: &mut FileHeader64<E> = object::from_bytes_mut(bytes).unwrap().0; in convert_object_elf_to_loadable_file()