summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-12-05 21:52:02 +0000
committerRui Ueyama <ruiu@google.com>2014-12-05 21:52:02 +0000
commitbe68a99f20ea2e6fb38e46b3675d3615a789bdfd (patch)
tree7167f262cc0bee3d811533b275663a683227cb38 /lld/lib/ReaderWriter
parentd8b766072beadac7f2e9498c2950277369a64712 (diff)
downloadbcm5719-llvm-be68a99f20ea2e6fb38e46b3675d3615a789bdfd.tar.gz
bcm5719-llvm-be68a99f20ea2e6fb38e46b3675d3615a789bdfd.zip
[PECOFF] Fix exported symbols in an import library.
Looks like if you have symbol foo in a module-definition file (.def file), and if the actual symbol name to match that export description is _foo@x (where x is an integer), the exported symbol name becomes this. - foo in the .dll file - foo@x in the .lib file I have checked in a few fixes recently for exported symbol name mangling. I haven't found a simple rule that governs all the mangling rules. There may not ever exist. For now, this is a patch to improve .lib file compatibility. llvm-svn: 223524
Diffstat (limited to 'lld/lib/ReaderWriter')
-rw-r--r--lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp b/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp
index d6081c1cf4b..fd3360f018b 100644
--- a/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/WriterImportLibrary.cpp
@@ -35,6 +35,8 @@ createModuleDefinitionFile(const PECOFFLinkingContext &ctx) {
os << " ";
if (!desc.externalName.empty()) {
os << desc.externalName;
+ } else if (!desc.mangledName.empty()) {
+ os << ctx.undecorateSymbol(desc.mangledName);
} else {
os << ctx.undecorateSymbol(desc.name);
}
OpenPOWER on IntegriCloud