create syscall and module libc-independent utils lib for proper NOT_CORE_PROPER sharing, including with tests
From bruen...@google.com on April 01, 2014 01:08:58
suite/tests/tools.c should share DR's raw syscalls: tools.c has a series of nolibc_*() routines and currently duplicates the asm routine dynamorio_syscall as nolibc_syscall. We should have a separate .asm file core/x86/syscall.asm that we can share.
Better to compile + link that one file in both dynamorio and test targets to avoid code duplication. We could additionally make it a static library to A) avoid duplicate compilation and B) ensure a clean interface.
While at it, split x86.asm and win32/ files to get rid of NOT_CORE_PROPER. Xref issue #1079 (closed) along with a lot of historic discussion but I don't think there was any issue filed until now.
Note that drfrontendlib pulls in module_{macho,elf}.c now, plus (the non-core-only part) of os.c, for os_open(), etc. drinjectlib is similar.
**** TODO where put isolated utils?
Keep in core/ in general, as everything that goes into the core should be there.
Candidates:
- core/lib/unix/module_macho.c, core/lib/x86/syscall.asm
- core/unix/lib_module_macho.c, core/lib/x86/lib_syscall.asm
- core/unix/module_macho_lib.c, core/lib/x86/syscall_lib.asm
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1409