The visibility and linkage information of symbols referring to IR
globals is broken. This patches fixes this while refactoring the code
setting symbol types in WasmSyms and emitting the external
declarations.
Emission of external declarations is now done in the first execution
of emitConstantPool rather than in emitLinkage (and a few other
places). This is the point where we have already gathered information
about used symbols (by running the MC Lower PrePass) and not yet
started emitting any functions so that any declarations that need to
be emitted are done so at the top of the file before any functions.
This changes the order of a few directives in the final asm file which
required an update to a few tests.
The other functions in this file start with a lowercase letter..