mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-27 18:59:30 +00:00
Add support for libcalls.
This commit is contained in:
@ -375,8 +375,26 @@ impl FuncTranslator {
|
||||
offset,
|
||||
addend,
|
||||
});
|
||||
} else if target.st_type() == goblin::elf::sym::STT_NOTYPE
|
||||
&& target.st_shndx == goblin::elf::section_header::SHN_UNDEF as _
|
||||
{
|
||||
// Not defined in this .o file implies that it should
|
||||
// be a libcall.
|
||||
let name = target.st_name;
|
||||
let name = elf.strtab.get(name).unwrap().unwrap();
|
||||
if let Some(libcall) = libcalls.get(name) {
|
||||
relocations.push(Relocation {
|
||||
kind,
|
||||
reloc_target: RelocationTarget::LibCall(*libcall),
|
||||
offset,
|
||||
addend,
|
||||
});
|
||||
} else {
|
||||
unimplemented!("reference to unknown libcall {}", name);
|
||||
}
|
||||
} else {
|
||||
unimplemented!("unknown relocation {:?} with target {:?}", reloc, target);
|
||||
}
|
||||
// TODO: runtime functions
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user