Investigate ELF packaging without an external linker

Archived MVP specification. For ASPL 0.7.0, see the current reference and native HTTP guide.

Type: research Status: resolved Parent: Find the ASPL MVP specification

Question

Which documented x86-64 glibc ELF mechanisms can a C11 ASPL tool use to emit a runnable native program containing a prebuilt register VM and program bytecode without invoking a compiler, assembler, or linker, and what constraints would each feasible mechanism place on dynamic dependencies, bytecode placement, process startup, and executable integrity?

Answer

Use a release-built x86-64 PIE VM template with a dedicated final read-only PT_LOAD segment. aspl build copies the embedded template, writes a versioned bytecode envelope into that segment, and patches only its file and memory sizes. The existing glibc startup path and fixed VM dependencies remain intact; program-specific shared libraries load at runtime through dlopen and dlsym. A self-reading file overlay is feasible but depends on procfs and startup file I/O, while rewriting dynamic ELF metadata would amount to implementing a linker. The emitter must validate the template and all ELF bounds, publish outputs atomically, and validate a payload integrity value before execution.

Full findings and primary-source citations: ELF packaging without an external linker