diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 0ef7c11737..cb624ea256 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -484,20 +484,22 @@ bool ZigLLVMWriteImportLibrary(const char *def_path, unsigned int coff_machine, } } - if (machine == COFF::IMAGE_FILE_MACHINE_I386 && kill_at) { + if (kill_at) { for (object::COFFShortExport& E : def->Exports) { if (!E.ImportName.empty() || (!E.Name.empty() && E.Name[0] == '?')) continue; - E.SymbolName = E.Name; + if (machine == COFF::IMAGE_FILE_MACHINE_I386) { + // By making sure E.SymbolName != E.Name for decorated symbols, + // writeImportLibrary writes these symbols with the type + // IMPORT_NAME_UNDECORATE. + E.SymbolName = E.Name; + } // Trim off the trailing decoration. Symbols will always have a // starting prefix here (either _ for cdecl/stdcall, @ for fastcall // or ? for C++ functions). Vectorcall functions won't have any // fixed prefix, but the function base name will still be at least // one char. E.Name = E.Name.substr(0, E.Name.find('@', 1)); - // By making sure E.SymbolName != E.Name for decorated symbols, - // writeImportLibrary writes these symbols with the type - // IMPORT_NAME_UNDECORATE. } }