Struct klinker::Linker [−][src]
pub struct Linker {}
Implementations
impl Linker
[src]
impl Linker
[src]pub fn link(
object_files: Vec<KOFile>,
debug: bool,
shared: bool
) -> Result<KSMFile, Box<dyn Error>>
[src]
object_files: Vec<KOFile>,
debug: bool,
shared: bool
) -> Result<KSMFile, Box<dyn Error>>
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]
object_file: &KOFile,
file_name: &str,
rel_instrs: &Vec<RelInstruction>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
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]
start_lc: u32,
functions: Vec<Function>
) -> Vec<Function>
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]
object_file: &KOFile,
file_name: &str,
section_index: i32
) -> Result<Symbol, Box<dyn Error>>
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]
main_code: Function,
init_code: Function,
functions: Vec<Function>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
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]
func: &Function,
func_map: &HashMap<String, u32>
) -> Result<Vec<SymInstr>, Box<dyn Error>>
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]
main_code: &Function,
init_code: &Function,
functions: &Vec<Function>
) -> HashMap<String, u32>
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 RefUnwindSafe for Linker
impl UnwindSafe for Linker
impl UnwindSafe for Linker