Oh definitely sounds plausible! Right now the main purpose of this tool is to just recover some of the deficiencies about not having a linker, primarily related to compiler-rt intrinsic definitions. We have to fake LLVM into exporting all the compiler-rt intrinsics to ensure they make their way to the end if they're used (afaik we can't detect which ones are needed). The wasm-gc tool is just then useful for eliminating the unused functions after the fact by just crawling the wasm and walking references and such.
That being said this tool won't be necessary with
lld just around the corner, and I also definitely don't plan to add many optimizations here!
export annotations? I'd imagine that by default it probably preserves them, but if it does then sounds like we should just use that instead!