diff options
author | Martin Storsjo <martin@martin.st> | 2017-08-16 05:22:49 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-08-16 05:22:49 +0000 |
commit | e1f120bbcb8ee5d90f60413296010ee0d3389b6a (patch) | |
tree | d0ad4fb2f68791d58ab092c26be53af16912e331 /llvm/lib/Object/COFFImportFile.cpp | |
parent | 58c9527eaf4f48f01718d5eea9409d1bf44878ce (diff) | |
download | llvm-e1f120bbcb8ee5d90f60413296010ee0d3389b6a.zip llvm-e1f120bbcb8ee5d90f60413296010ee0d3389b6a.tar.gz llvm-e1f120bbcb8ee5d90f60413296010ee0d3389b6a.tar.bz2 |
[COFF] Make the weak aliases optional
When creating an import library from lld, the cases with
Name != ExtName shouldn't end up as a weak alias, but as a real
export of the new name, which is what actually is exported from
the DLL.
This restores the behaviour of renamed exports to what it was in
4.0.
The other half of this commit, including test, goes into lld.
Differential Revision: https://reviews.llvm.org/D36633
llvm-svn: 310991
Diffstat (limited to 'llvm/lib/Object/COFFImportFile.cpp')
-rw-r--r-- | llvm/lib/Object/COFFImportFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/COFFImportFile.cpp b/llvm/lib/Object/COFFImportFile.cpp index 8d0f82e..8383edf 100644 --- a/llvm/lib/Object/COFFImportFile.cpp +++ b/llvm/lib/Object/COFFImportFile.cpp @@ -560,7 +560,7 @@ NewArchiveMember ObjectFactory::createWeakExternal(StringRef Sym, std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, ArrayRef<COFFShortExport> Exports, - MachineTypes Machine) { + MachineTypes Machine, bool MakeWeakAliases) { std::vector<NewArchiveMember> Members; ObjectFactory OF(llvm::sys::path::filename(ImportName), Machine); @@ -578,7 +578,7 @@ std::error_code writeImportLibrary(StringRef ImportName, StringRef Path, if (E.Private) continue; - if (E.isWeak()) { + if (E.isWeak() && MakeWeakAliases) { Members.push_back(OF.createWeakExternal(E.Name, E.ExtName, false)); Members.push_back(OF.createWeakExternal(E.Name, E.ExtName, true)); continue; |