I am half-way tempted to say screw it all, and just write my own Modula-2 compiler, rewrite my assembler to emit Hunk-format object files, and create a linker that will create Hunk-format executables and libraries.
ELF, like systemd that came long after it, is perhaps one of the most egregious violations of the Unix philosophy that I've ever seen. A horrible, horrible file format.