From: Hans Wennborg Date: Thu, 17 Aug 2017 16:57:03 +0000 (+0000) Subject: Merging r310988: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5782e7a2b95be0477584cd33d0112d7b216b2ac4;p=llvm Merging r310988: ------------------------------------------------------------------------ r310988 | mstorsjo | 2017-08-15 22:13:16 -0700 (Tue, 15 Aug 2017) | 8 lines [COFF] Add SymbolName as a distinct field in COFFImportFile The previous Name and ExtName aren't enough to convey all the nuances between weak aliases and stdcall decorated function names. A test for this will be added in LLD. Differential Revision: https://reviews.llvm.org/D36544 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@311096 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Object/COFFImportFile.h b/include/llvm/Object/COFFImportFile.h index 8e215b565fc..f6db943c2de 100644 --- a/include/llvm/Object/COFFImportFile.h +++ b/include/llvm/Object/COFFImportFile.h @@ -73,6 +73,7 @@ private: struct COFFShortExport { std::string Name; std::string ExtName; + std::string SymbolName; uint16_t Ordinal = 0; bool Noname = false; diff --git a/lib/Object/COFFImportFile.cpp b/lib/Object/COFFImportFile.cpp index a515bc8ad16..83a11cb6db0 100644 --- a/lib/Object/COFFImportFile.cpp +++ b/lib/Object/COFFImportFile.cpp @@ -587,7 +587,7 @@ std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, if (E.Constant) ImportType = IMPORT_CONST; - StringRef SymbolName = E.isWeak() ? E.ExtName : E.Name; + StringRef SymbolName = E.SymbolName.empty() ? E.Name : E.SymbolName; ImportNameType NameType = getNameType(SymbolName, E.Name, Machine); Expected Name = E.ExtName.empty() ? SymbolName