Struct klinker::Linker[][src]

pub struct Linker {}

Implementations

impl Linker[src]

pub fn get_comment(object_file: &KOFile) -> Result<String, Box<dyn Error>>[src]

Returns the string that is contained in the .comment section of the object file, or an empty string if there was none

pub fn get_file_name(object_file: &KOFile) -> Result<String, Box<dyn Error>>[src]

Returns the source file name as a string, if none exists, an empty string is returned

pub fn rel_to_sym(
    object_file: &KOFile,
    file_name: &str,
    rel_instrs: &Vec<RelInstruction>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
[src]

Turns RelInstructions using the symbol table into SymInstrs so that they don’t have to rely on symbol table indexes

pub fn safeify_functions(
    start_lc: u32,
    functions: Vec<Function>
) -> Vec<Function>
[src]

Adds two label resets to the beginnings of each function, which sets the function’s label to it’s name

pub fn get_func_sym(
    object_file: &KOFile,
    file_name: &str,
    section_index: i32
) -> Result<Symbol, Box<dyn Error>>
[src]

Searches through the object file’s symbol table for a function symbol with a section index that matches the given index

pub fn relocate_code(
    main_code: Function,
    init_code: Function,
    functions: Vec<Function>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
[src]

Performs relocation of function sections and initialization sections to form the text of the final executable

pub fn resolve_shared_func_refs(func: &Function) -> Vec<SymInstr>[src]

This function will resolve any references to functions within another function, but called in a manner for shared objects This returns a vector of SymInstr where no operands will be function references

pub fn resolve_func_refs(
    func: &Function,
    func_map: &HashMap<String, u32>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
[src]

This function will resolve any references to functions within another function This returns a vector of SymInstr where no operands will be function references

pub fn get_func_locations(
    main_code: &Function,
    init_code: &Function,
    functions: &Vec<Function>
) -> HashMap<String, u32>
[src]

Does a run through all of the provided code, and returns a map of function names to locations in the code This assumes that the output will be an executable

Auto Trait Implementations

impl RefUnwindSafe for Linker

impl Send for Linker

impl Sync for Linker

impl Unpin for Linker

impl UnwindSafe for Linker

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.