summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-05-09 09:21:53 +0000
committerMartin Storsjo <martin@martin.st>2018-05-09 09:21:53 +0000
commit284ab80f8d055bb350246c6e28d9a5579d784144 (patch)
treee239cdf69d0fedfc4842f6cfdf983bb213054252 /llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
parentf1f8f4a1fd116323a6c4f3a4bde87243bab5668d (diff)
downloadbcm5719-llvm-284ab80f8d055bb350246c6e28d9a5579d784144.tar.gz
bcm5719-llvm-284ab80f8d055bb350246c6e28d9a5579d784144.zip
[COFF] Improve correctness of def parsing for GNU features
The operator == used for exporting a function with a different name in the DLL compared to the name in the import library (which is useful for adding linker level aliases for function in the import library) is a feature distinct and different from the operator = used for exporting a function with a different name (both in import library and DLL) than in the implementation producing the DLL. When creating an import library using dlltool, from a def file that contains forwards (Func = OtherDll.Func), this shouldn't affect the produced import library, which should still behave just as if it was a normal exported function. This clears a lot of confusion and subtle misunderstandings, and avoids a parameter that was used to avoid creating weak aliases when invoked from lld. (This parameter was added previously due to the existing conflation of the two features.) Differential Revision: https://reviews.llvm.org/D46245 llvm-svn: 331859
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp')
-rw-r--r--llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
index 684617e7945..f8de7ca7392 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
@@ -158,7 +158,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
if (Machine == IMAGE_FILE_MACHINE_I386 && Args.getLastArg(OPT_k)) {
for (COFFShortExport& E : Def->Exports) {
- if (E.isWeak() || (!E.Name.empty() && E.Name[0] == '?'))
+ if (!E.AliasTarget.empty() || (!E.Name.empty() && E.Name[0] == '?'))
continue;
E.SymbolName = E.Name;
// Trim off the trailing decoration. Symbols will always have a
@@ -173,7 +173,7 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
}
}
- if (writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true, true))
+ if (writeImportLibrary(Def->OutputFile, Path, Def->Exports, Machine, true))
return 1;
return 0;
}
OpenPOWER on IntegriCloud