Commit 5e2b025f69
Changed files (1)
src
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.
}
}