add function calls and maybe fix function call relocations?

This commit is contained in:
Folkert 2023-09-14 20:26:50 +02:00
parent 356f225b5d
commit 027b8aff4d
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 22 additions and 3 deletions

View file

@ -858,8 +858,13 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
}
#[inline(always)]
fn call(_buf: &mut Vec<'_, u8>, _relocs: &mut Vec<'_, Relocation>, _fn_name: String) {
todo!("calling functions literal for AArch64");
fn call(buf: &mut Vec<'_, u8>, relocs: &mut Vec<'_, Relocation>, fn_name: String) {
let inst = 0b1001_0100_0000_0000_0000_0000_0000u32;
buf.extend(inst.to_le_bytes());
relocs.push(Relocation::LinkedFunction {
offset: buf.len() as u64 - 4,
name: fn_name,
});
}
#[inline(always)]

View file

@ -731,6 +731,9 @@ impl<
fn relocations_mut(&mut self) -> &mut Vec<'a, Relocation> {
&mut self.relocs
}
fn target_info(&self) -> TargetInfo {
self.storage_manager.target_info
}
fn module_interns_helpers_mut(
&mut self,
) -> (