#stack #elf #elf-binary #auxv #auxval

no-std crt0stack

Tools for reading and creating Linux crt0 stack data

1 unstable release

0.1.0 Aug 19, 2020

#182 in No standard library

Download history 1042/week @ 2023-12-11 354/week @ 2023-12-18 132/week @ 2023-12-25 89/week @ 2024-01-01 113/week @ 2024-01-08 302/week @ 2024-01-15 102/week @ 2024-01-22 258/week @ 2024-01-29 172/week @ 2024-02-05 118/week @ 2024-02-12 139/week @ 2024-02-19 335/week @ 2024-02-26 181/week @ 2024-03-04 160/week @ 2024-03-11 88/week @ 2024-03-18 125/week @ 2024-03-25

574 downloads per month
Used in 6 crates (5 directly)

Apache-2.0

38KB
799 lines

Workflow Status Average time to resolve an issue Percentage of issues still open Maintenance

crt0stack

Create the initial stack frame to start an ELF binary on Linux

Examples

use crt0stack::{Builder, Entry};

let mut stack = [1u8; 512];
let stack = stack.as_mut();

let mut builder = Builder::new(stack);

builder.push("/init").unwrap();
let mut builder = builder.done().unwrap();

builder.push("HOME=/root").unwrap();
let mut builder = builder.done().unwrap();

let auxv = [
    Entry::Gid(1000),
    Entry::Uid(1000),
    Entry::Platform("x86_64"),
    Entry::ExecFilename("/init"),
];
auxv.iter().for_each(|e| builder.push(e).unwrap());

let handle = builder.done().unwrap();

License: Apache-2.0

No runtime deps

Features