summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFImportFile.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2019-05-22 09:49:54 +0000
committerMartin Storsjo <martin@martin.st>2019-05-22 09:49:54 +0000
commitde6038b26507ee962b0dfd8835133b12658dc2aa (patch)
tree1665732403f7246b3930ea463cd32fd4bfb7978b /llvm/lib/Object/COFFImportFile.cpp
parentf8f93ba90d2672bf2f469b476ee2e1ff426baa30 (diff)
downloadbcm5719-llvm-de6038b26507ee962b0dfd8835133b12658dc2aa.tar.gz
bcm5719-llvm-de6038b26507ee962b0dfd8835133b12658dc2aa.zip
[llvm-dlltool] Respect NONAME keyword
This adds proper handling of the NONAME-keyword, which makes llvm-dlltool generate an import using the ordinal instead of the name. Patch by by Jannik Vogel, test added by Stefan Schmidt. Differential Revision: https://reviews.llvm.org/D62175 llvm-svn: 361367
Diffstat (limited to 'llvm/lib/Object/COFFImportFile.cpp')
-rw-r--r--llvm/lib/Object/COFFImportFile.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Object/COFFImportFile.cpp b/llvm/lib/Object/COFFImportFile.cpp
index f821b51a9e1..ff4a799be60 100644
--- a/llvm/lib/Object/COFFImportFile.cpp
+++ b/llvm/lib/Object/COFFImportFile.cpp
@@ -595,7 +595,10 @@ Error writeImportLibrary(StringRef ImportName, StringRef Path,
ImportType = IMPORT_CONST;
StringRef SymbolName = E.SymbolName.empty() ? E.Name : E.SymbolName;
- ImportNameType NameType = getNameType(SymbolName, E.Name, Machine, MinGW);
+ ImportNameType NameType = E.Noname
+ ? IMPORT_ORDINAL
+ : getNameType(SymbolName, E.Name,
+ Machine, MinGW);
Expected<std::string> Name = E.ExtName.empty()
? SymbolName
: replace(SymbolName, E.Name, E.ExtName);
OpenPOWER on IntegriCloud