You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faster loading, because mldr will no longer be involved.
Makes things a bit cleaner.
And disadvantages:
We'll have to redo our approach to calling ELF APIs.
Steps - Mach-O
Load Mach-Os in kernel. See if we can adapt Wenqi's code for this.
Move commpage generation into the kernel.
Hide /dev/mach from userspace. Open devmach fd inside the kernel Mach-O loader (and make it O_CLOEXEC).
Provide information to dyld_info in the XNU task (needed for debuggers).
Remove /dev/mach opening from libsystem_kernel. Maybe we could get the fd number via apple[] args to entry point?
Steps - ELF
Introduce a library for loading ELF files...:
Create a simple ELF loader (similar to the kernel ELF loader - no dynamic library loading).
Create an ELF stub that gets jumped into by the loader (dynamic loader) and returns control back into Mach-O (while passing along fnptrs to dlopen() and friends). We could pass a function pointer via argv[] and this function would longjmp() back in order to rewind the stack.
Modify libsystem_kernel to access our ELF wrapper for bsdthread_* syscall implementation.
More Ideas
Provide commpage contents as a mmap from the devmach fd. The devmach fd would then be closed before jumping to the entry point. This way we'd avoid polluting the fd table, but still learn about process termination (the memory mapping destruction would close the struct file*).
Register an IDT entry (e.g. 0x83) for using for LKM calls instead of ioctl() and do int 0x83 to make LKM calls.
The text was updated successfully, but these errors were encountered:
Called after LLDB receives SIGTRAP for the exec() that just happened. task_t should be ready when this signal is delivered. (Should already be the case, because this is supposed to be generated once the new process is ready to run.)
PosixSpawnChildForPTraceDebugging:
Uses ptrace(PT_ATTACHEXC) - maybe this should wait until attachable?
-> We should probably block the RT signals we use for ptrace() impl until the child process is ready to handle it.
In relation to #304 (getting LLDB working under Darling), we need to move Mach-O loading to the kernel.
This has several benefits:
mldr
will no longer be involved.And disadvantages:
Steps - Mach-O
/dev/mach
from userspace. Open devmach fd inside the kernel Mach-O loader (and make it O_CLOEXEC)./dev/mach
opening from libsystem_kernel. Maybe we could get the fd number viaapple[]
args to entry point?Steps - ELF
argv[]
and this function wouldlongjmp()
back in order to rewind the stack.More Ideas
struct file*
).ioctl()
and doint 0x83
to make LKM calls.The text was updated successfully, but these errors were encountered: