summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-10-23 09:08:13 +0000
committerMartin Storsjo <martin@martin.st>2017-10-23 09:08:13 +0000
commit843cbbddebf8451a8661334cacc4dd608a1f0683 (patch)
tree00c4af9ad0cde25f06f1fca3fefaf9837c50a7d8 /llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
parent1afddd4136c0ce9850b9557ecd347e30f1c7d63e (diff)
downloadbcm5719-llvm-843cbbddebf8451a8661334cacc4dd608a1f0683.tar.gz
bcm5719-llvm-843cbbddebf8451a8661334cacc4dd608a1f0683.zip
[COFF] Improve the check for functions that should get an extra underscore
This fixes exporting functions starting with an underscore, and fully decorated fastcall/vectorcall functions. Tests will be added in the lld repo. Differential Revision: https://reviews.llvm.org/D39168 llvm-svn: 316316
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
index eb9b9c3b264..3891efae57b 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -165,8 +165,9 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
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 also will end up having
- // a prefix here, even if they shouldn't.)
+ // 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
OpenPOWER on IntegriCloud