3 ms·
> this incredibly fun activity called linker scripting Indeed. :-) > I chose to hack together an ELF patching tool in order to get Linux to automatically load
by loeg 3y ago
> this incredibly fun activity called linker scripting
Indeed. :-)
> I chose to hack together an ELF patching tool in order to get Linux to automatically load arbitrary ELF file segments onto memory.
Interesting. It's clever. I think a slightly more conventional design would be to have just a LOAD segment for your embedded module (for the loader) with some self-describing application-specific header describing the length of the embedded script (for your interpreter), rather than using the ELF Segments table (LOOS+0xc6f6e65) for that.
A dumber hack with less cool learning about ELF might be to just have a magic number variable in your interpreter that is initialized bogus and then patched to point at an offset by the patching tool.