elf_loader 0.17.0

A no_std-friendly ELF loader and runtime linker for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use elf_loader::{Error, Loader, error::TlsError, input::ElfBinary};
use std::fs;

#[test]
fn requires_resolver() {
    let path = crate::fixture::build();
    let bytes = fs::read(path).expect("failed to read TLS fixture");

    let error = Loader::new()
        .load_dylib(ElfBinary::new("tls.so", &bytes))
        .expect_err("TLS image should fail to load without a resolver");
    assert!(matches!(error, Error::Tls(TlsError::ResolverUnsupported)));
}