jacereda

Results 162 comments of jacereda

I guess I can just open the `/usr/bin/env` ELF and look for the PT_INTERP field...

I think NetBSD should work now, but I'm unable to test because I can't get acceleration working on qemu... Anyone willing to help testing it?

OpenBSD is hard. I'm hitting this check: https://github.com/openbsd/src/blob/2207c4325726fdc5c4bcd0011af0fdf7d3dab137/sys/sys/syscall_mi.h#L88 Given that the cosmopolitan binary is static, manually loading the helper (dynamic executable) won't do the trick, as soon as `ld.so` attempts...

Good idea. My preliminary tests still fail and my guess is that `msyscall` will only affect already-mapped memory. I'll try the empty block thing next.

There's a problem with that approach, I'm not loading libc, I'm just loading the interpreter and the interpreter will load libc. So that would just allow the interpreter to do...

The interpreter is /usr/libexec/ld.so I'm using the interpreter to avoid dealing with the relocations and all that, but that might be an option.

I can try mapping the region where libc will be loaded prior to calling `msyscall`, could that do the trick?

On OpenBSD libc is loaded at some random region at 0x2xxxxxxxx and on Linux it's 0x7fxxxxxxxxxx. Dunno about other platforms right now...

Nah, forget that, that's the region where the interpreter itself is loaded...