mirror of
https://github.com/Noratrieb/rustv32i.git
synced 2026-01-16 22:35:02 +01:00
start tests
This commit is contained in:
parent
ca565ddeb3
commit
0af012d43a
10 changed files with 412 additions and 118 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use eyre::{Result, bail};
|
||||
|
||||
pub struct Elf {
|
||||
pub content: Vec<u8>,
|
||||
pub struct Elf<'a> {
|
||||
pub content: &'a [u8],
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -30,7 +30,7 @@ pub struct Phdr {
|
|||
pub p_align: u32,
|
||||
}
|
||||
|
||||
impl Elf {
|
||||
impl<'a> Elf<'a> {
|
||||
pub fn header(&self) -> Result<Header> {
|
||||
let (ident, rest) = self.content.split_bytes(16)?;
|
||||
if ident[..4] != *b"\x7fELF" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue