⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

prepare_dynamic_linking

Function prepare_dynamic_linking 

Source
pub fn prepare_dynamic_linking(
    _elf_data: &[u8],
    elf_binary: &ElfBinary,
    load_base: u64,
) -> Result<Option<DynamicLinkerInfo>, KernelError>
Expand description

Prepare everything needed to run a dynamically linked ELF binary.

This function:

  1. Checks whether the binary has an interpreter.
  2. Loads the interpreter (if present) using the ELF loader.
  3. Builds the auxiliary vector for the dynamic linker.

Returns a DynamicLinkerInfo with all information needed to start the process. If the binary is statically linked, returns None.

§Arguments

  • _elf_data - Raw bytes of the ELF file (reserved for future use).
  • elf_binary - Pre-parsed ELF binary metadata.
  • load_base - Base address where the main binary was loaded.