[PATCH] D36544: [COFF] Add SymbolName as a distinct field in COFFImportFile

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 12:48:28 PDT 2017


mstorsjo created this revision.

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.


https://reviews.llvm.org/D36544

Files:
  include/llvm/Object/COFFImportFile.h
  lib/Object/COFFImportFile.cpp


Index: lib/Object/COFFImportFile.cpp
===================================================================
--- lib/Object/COFFImportFile.cpp
+++ lib/Object/COFFImportFile.cpp
@@ -590,7 +590,7 @@
     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<std::string> Name = E.ExtName.empty()
                                      ? SymbolName
Index: include/llvm/Object/COFFImportFile.h
===================================================================
--- include/llvm/Object/COFFImportFile.h
+++ include/llvm/Object/COFFImportFile.h
@@ -73,6 +73,7 @@
 struct COFFShortExport {
   std::string Name;
   std::string ExtName;
+  std::string SymbolName;
 
   uint16_t Ordinal = 0;
   bool Noname = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36544.110458.patch
Type: text/x-patch
Size: 922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/fd3b2c79/attachment.bin>


More information about the llvm-commits mailing list