diff options
author | Martin Storsjo <martin@martin.st> | 2017-08-16 05:13:25 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-08-16 05:13:25 +0000 |
commit | ee09cb20637dbc101beedf14f2b92be89945cfa0 (patch) | |
tree | 1c7ae75b88f28078eaa10c8e4aad0bc24116e2ba /COFF | |
parent | fde1ed87ae6f4f3d2e862dc2931bb8b3d9ce97fe (diff) |
[COFF] Fix the name type for stdcall functions in import libraries
Since SVN r303491 and r304573, LLD used the COFFImportLibrary
functions from LLVM. These only had two names, Name and ExtName,
which wasn't enough to convey all the details of stdcall functions.
Stdcall functions got the wrong symbol name in the import library
itself in r303491, which is why it was reverted in r304561. When
re-landed and fixed in r304573 (after adding a test in r304572),
the symbol name itself in the import library ended up right, but the
name type of the import library entry was wrong.
This had the effect that linking to the import library succeeded
(contrary to in r303491, where linking to such an import library
failed), but at runtime, the symbol wouldn't be found in the DLL
(since the caller linked to the stdcall decorated name).
Differential Revision: https://reviews.llvm.org/D36545
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@310989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'COFF')
-rw-r--r-- | COFF/Driver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/COFF/Driver.cpp b/COFF/Driver.cpp index e3baf9e7e..5f1aa3dee 100644 --- a/COFF/Driver.cpp +++ b/COFF/Driver.cpp @@ -461,8 +461,8 @@ static void createImportLibrary(bool AsLib) { std::vector<COFFShortExport> Exports; for (Export &E1 : Config->Exports) { COFFShortExport E2; - // Use SymbolName, which will have any stdcall or fastcall qualifiers. - E2.Name = E1.SymbolName; + E2.Name = E1.Name; + E2.SymbolName = E1.SymbolName; E2.ExtName = E1.ExtName; E2.Ordinal = E1.Ordinal; E2.Noname = E1.Noname; |