Skip to content

Commit

Permalink
Implement syscall 596 (#431)
Browse files Browse the repository at this point in the history
Co-authored-by: tompro <tomas.prochazka@apertia.cz>
  • Loading branch information
SuchAFuriousDeath and SuchAFuriousDeath authored Nov 9, 2023
1 parent d077133 commit 453cd5b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/kernel/src/rtld/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl<E: ExecutionEngine> RuntimeLinker<E> {

sys.register(591, &ld, Self::sys_dynlib_dlsym);
sys.register(592, &ld, Self::sys_dynlib_get_list);
sys.register(596, &ld, Self::sys_dynlib_do_copy_relocations);
sys.register(598, &ld, Self::sys_dynlib_get_proc_param);
sys.register(599, &ld, Self::sys_dynlib_process_needed_and_relocate);
sys.register(608, &ld, Self::sys_dynlib_get_info_ex);
Expand Down Expand Up @@ -430,6 +431,20 @@ impl<E: ExecutionEngine> RuntimeLinker<E> {
Ok(SysOut::ZERO)
}

fn sys_dynlib_do_copy_relocations(self: &Arc<Self>, i: &SysIn) -> Result<SysOut, SysErr> {
if let Some(info) = self.app.file_info() {
for reloc in info.relocs() {
if reloc.ty() == Relocation::R_X86_64_COPY {
return Err(SysErr::Raw(EINVAL));
}
}

Ok(SysOut::ZERO)
} else {
Err(SysErr::Raw(EPERM))
}
}

fn sys_dynlib_get_proc_param(self: &Arc<Self>, i: &SysIn) -> Result<SysOut, SysErr> {
// Get arguments.
let param: *mut usize = i.args[0].into();
Expand Down

0 comments on commit 453cd5b

Please sign in to comment.