ltvm: remove unneccesary symbol table
(handled in linker now)
This commit is contained in:
parent
45869fdd30
commit
a948b53d9a
1 changed files with 0 additions and 12 deletions
|
@ -25,24 +25,12 @@ fn main() {
|
||||||
let mut vm = tisc::VM::new( args.memsize );
|
let mut vm = tisc::VM::new( args.memsize );
|
||||||
let mut linker = tisc::Linker::new();
|
let mut linker = tisc::Linker::new();
|
||||||
|
|
||||||
let mut symbols = std::collections::HashMap::<String, tisc::LinkAddr>::new();
|
|
||||||
|
|
||||||
for source_path in args.sources.iter() {
|
for source_path in args.sources.iter() {
|
||||||
let mut input = std::io::BufReader::new(
|
let mut input = std::io::BufReader::new(
|
||||||
std::fs::File::open(source_path).expect("Failed to open file")
|
std::fs::File::open(source_path).expect("Failed to open file")
|
||||||
);
|
);
|
||||||
|
|
||||||
let obj_file : tisc::linker::ObjectFile = bincode::deserialize_from( input ).expect("");
|
let obj_file : tisc::linker::ObjectFile = bincode::deserialize_from( input ).expect("");
|
||||||
|
|
||||||
for (name, addr) in obj_file.symbols.iter() {
|
|
||||||
symbols.insert(
|
|
||||||
name.clone(),
|
|
||||||
tisc::LinkAddr::Relative{
|
|
||||||
symbol: source_path.clone(),
|
|
||||||
offset: *addr
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
linker.import( source_path, obj_file );
|
linker.import( source_path, obj_file );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue