Function elf2tab::convert::elf_to_tbf

source ·
pub fn elf_to_tbf(
    input_file: &mut File,
    output: &mut Vec<u8>,
    package_name: Option<String>,
    verbose: bool,
    stack_len: Option<u32>,
    app_heap_len: u32,
    kernel_heap_len: u32,
    protected_region_size_arg: Option<u32>,
    permissions: Vec<(u32, u32)>,
    storage_ids: (Option<u32>, Option<Vec<u32>>, Option<Vec<u32>>),
    kernel_version: Option<(u16, u16)>,
    disabled: bool,
    minimum_footer_size: u32,
    app_version: u32,
    sha256: bool,
    sha384: bool,
    sha512: bool,
    rsa4096_private_key: Option<PathBuf>
) -> Result<()>
Expand description

Convert an ELF file to a TBF (Tock Binary Format) binary file.

This will place all segments from the ELF file into a binary and prepend a TBF header to it. For all writeable sections in the included segments, if there is a .rel.X section it will be included at the end with a 32 bit length parameter first.

Assumptions:

  • Any segments that are writable and set to be loaded into flash but with a different virtual address will be in RAM and should count towards minimum required RAM.
  • Sections that are writeable flash regions include .wfr in their name.