pub fn replace_nano_core_crates(
    namespace: &Arc<CrateNamespace>,
    nano_core_crate_ref: StrongCrateRef,
    kernel_mmi_ref: &MmiRef
) -> Result<(), &'static str>
Expand description

See the module-level documentation for how this works.

Current Limitations

Currently, this does not actually rewrite the existing sections in the nano_core itself to redirect them to depend on the newly-loaded crate instances. All it can do is replace the existing nano_core This is a limitation that we’re working to overcome, and is difficult because we need to obtain a list of all linker relocations that were performed by the static linker such that we can properly rewrite the existing dependencies. For simple relocations like RX86_64_64 where the value is just an absolute address, it would be straightforward to simply scan the nano_core’s kernel.bin binary file for each section’s virtual address in order to derive/recover the relocations and dependencies between sections, but it’s not always that simple for other relocation types. Perhaps we can ask the linker to emit a list of relocations it performs and then provide that list as input into this function so that it doesn’t have to guess when deriving relocations.