Earlier quoted context omitted.
OCaml uses C's linker model, and yet still manages to have working Modula-like modules (even with cross-module inlining). So there's an existence proof that it's possible to do it well.
Where can I learn more about it in a high level way instead of delving into source code? I am curious how it is done in a portable way across all OSes, specially crude system linkers and OSes without POSIX semantics. For example, I imagine this can be made via ELF sections, but not all OSes use ELF.
More generally speaking: The trick must be to not generate identical instantiations multiple times. So you must have a way to check, if you already generated it. Of course, the devil is in the details (e.g. is equivalence on the syntactic level enough?).