MakeImport: quote symbol names so we can handle some strange characters (Metrowerks used <> in name mangling)

This commit is contained in:
Wolfgang Thaller 2022-01-29 18:48:35 +01:00
parent b1dce6dc57
commit 2c82570c17
1 changed files with 9 additions and 9 deletions

View File

@ -181,27 +181,27 @@ void MakeImportLibrary(char *pefptr, size_t pefsize, fs::path dest, fs::path tmp
{
expFile << sym << endl;
sFile << ".text" << endl;
sFile << "\t.globl " << sym << endl;
sFile << "\t.globl ." << sym << endl;
sFile << "\t.csect " << sym << "[DS]" << endl;
sFile << sym << ':' << endl;
sFile << ".long ." << sym << ", TOC[tc0], 0" << endl;
sFile << "\t.globl " << '"' << sym << '"' << endl;
sFile << "\t.globl " << '"' << '.' << sym << '"' << endl;
sFile << "\t.csect " << '"' << sym << "[DS]" << '"' << endl;
sFile << '"' << sym << '"' << ':' << endl;
sFile << ".long " << '"' << '.' << sym << '"' << ", TOC[tc0], 0" << endl;
sFile << ".text" << endl;
sFile << '.' << sym << ':' << endl;
sFile << '"' << '.' << sym << '"' << ':' << endl;
sFile << "\tblr" << endl;
}
else if(exportedSymbols[i].second == kPEFDataSymbol)
{
expFile << sym << endl;
sFile << "\t.globl " << sym << endl;
sFile << "\t.globl " << '"' << sym << '"' << endl;
sFile << "\t.csect .data[RW],3" << endl;
sFile << "\t.align 2" << endl;
sFile << sym << ':' << endl;
sFile << '"' << sym << '"' << ':' << endl;
sFile << "\t.long\t42" << endl;
}
}
//cerr << "Generating: " << name << " -> " << libname << endl;
//cerr << "Generating: " << stub_s.string() << " -> " << stub_o.string() << endl;
RunCommand("powerpc-apple-macos-as", std::vector<std::string> {
stub_s.string(), "-o", stub_o.string()
});