4 ms·
I guess you could include your own dynamic linker in your binary. Mmap the shared object, perform the relocations, etc. It seems like you could write a static l
by bpye 4y ago
I guess you could include your own dynamic linker in your binary. Mmap the shared object, perform the relocations, etc. It seems like you could write a static library to do this so that the Redox itself doesn't need any specific support?
- zokier 4y agoWith PIC you wouldn't even need to do relocs?
- bpye 4y agoMakes it easier, but you can't entirely avoid relocations. https://eli.thegreenplace.net/2011/11/03/position-independent-code-pic-in-shared-libraries https://eli.thegreenplace.net/2011/11/03/position-independen... seems like a decent explanation.
- brendank310 4y agoWe took this approach with the first version of a from-scratch hypervisor at my last job. Portions of the hypervisor were separated into different shared libraries and we wrote a custom ELF loader to do the relocations. It was interesting but ultimately it was scratched in favor of a large static binary.