Get cosmo_dlopen() working better on System Five

Imported functions are now aspected with a trampoline that blocks
signals and changes the thread-local storage register. This means
bigger more complicated libraries can now be imported even though
the whole technique remains fundamentally unsafe.
This commit is contained in:
Justine Tunney 2023-11-15 10:48:31 -08:00
parent 3a470ed356
commit e4584ace81
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 304 additions and 190 deletions

View file

@ -176,7 +176,7 @@ struct ElfWriter *elfwriter_open(const char *path, int mode, int arch) {
#elif defined(__riscv)
arch = EM_RISCV;
#elif defined(__s390x__)
elf->ehdr->e_machine = EM_S390;
arch = EM_S390;
#else
#error "unsupported architecture"
#endif