Your executable is a SQLite database
Summary
Fzakaria proposes replacing the ELF executable format with SELF, a Structured Executable & Linkable Format that uses a SQLite database to store program segments, symbols, and metadata.
ELF is a manual database.
The ELF format implements database primitives like string interning and indexing by hand using structures like .strtab and .gnu.hash instead of a standard engine.
ELF is already a database. It just implements many database primitives by hand
SELF simplifies executable manipulation.
Tools like strip or patchelf become standard SQL transactions, such as DELETE and UPDATE, avoiding fragile offset surgery on packed binary sections.
Any tool that modifies an ELF file, like strip, can operate on the database within a transaction
SQLite overhead amortizes at scale.
A single SELF file can be twice the size of an ELF, but a 723-executable userland in one database is 611.9 MiB, smaller than the original 644.4 MiB of ELF files.
The whole userland, as one queryable file, is smaller than the files it came from.
Closures eliminate dependency ambiguity.
By storing resolved paths in the database, SELF creates a single-file closure where shared library resolution is a foreign key join rather than a soname guess.
Shared library resolution stops being a guess and becomes a foreign key
Database transactions enable atomic system changes.
System-wide modifications like LD_PRELOAD can be managed as rows in a table, allowing an entire userland to be updated or rolled back in one transaction.
Read the original ↗Save to Sponge
Summarized with Sponge. Quotes are the author’s own words.