Previously, the created object files for the import library were broken. Write the symbol table before the string table. Simplify the code by using a separate variable Prefix instead of duplicating a few lines.
Also update the coff-weak-exports to actually check that the generated weak symbols can be found as intended.