简体   繁体   English

如何在Google Native Client中进行自定义系统调用

[英]How to make a custom system call in Google Native Client

I have made the necessary changes to the following files irt_syscalls, nacl_syscalls, nacl_syscalls, nacl_syscalls_common, nacl_syscalls_handler_gen.py 我对以下文件进行了必要的更改irt_syscalls,nacl_syscalls,nacl_syscalls,nacl_syscalls_common,nacl_syscalls_handler_gen.py

but I get Undefined reference to NaClSysLibcall (the system call I'm trying to make) while compiling NaCl code 但是我在编译NaCl代码时得到了对NaClSysLibcall的未定义引用(我正在尝试进行的系统调用)

since you are implementing a custom syscall, i'll assume you do not want to run inside of chrome and you just want to run code via sel_ldr. 由于您要实现自定义的系统调用,因此我假设您不想在chrome内运行,而只想通过sel_ldr运行代码。

IIRC the SDK, whether you want newlib or glibc, was built in the chromium tree, and getting the C syscall wrapper to build is probably going to be a pain since you'd need to fetch all of chromium; IIRC SDK,无论您要newlib还是glibc,都是在铬树中构建的,要构建C syscall包装器可能会很痛苦,因为您需要获取所有铬。 worse, the SDK source may have already been eradicated from the chromium tree. 更糟糕的是,SDK源可能已经从铬树中消除了。

an easier way might be to just write your own syscall wrapper that calls the address in the trampoline region that corresponds to the syscall. 一种更简单的方法可能是编写您自己的syscall包装器,该包装器调用与该syscall相对应的蹦床区域中的地址。 you can disassemble an existing syscall wrapper to see what the code ought to look like. 您可以反汇编现有的syscall包装器,以查看代码的外观。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM