summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/lib/ReaderWriter/PECOFF/EdataPass.cpp')
-rw-r--r--lld/lib/ReaderWriter/PECOFF/EdataPass.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
index a0475301c86..8d6424138e7 100644
--- a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
@@ -46,7 +46,9 @@ static void assignOrdinals(PECOFFLinkingContext &ctx) {
ctx.getDllExports().swap(exports);
}
-static StringRef removeAtSignSuffix(StringRef sym) {
+static StringRef removeStdcallSuffix(StringRef sym) {
+ if (!sym.startswith("_"))
+ return sym;
StringRef trimmed = sym.rtrim("0123456789");
if (sym.size() != trimmed.size() && trimmed.endswith("@"))
return trimmed.drop_back();
@@ -63,7 +65,7 @@ static bool getExportedAtoms(PECOFFLinkingContext &ctx, MutableFile *file,
std::vector<TableEntry> &ret) {
std::map<StringRef, const DefinedAtom *> definedAtoms;
for (const DefinedAtom *atom : file->defined())
- definedAtoms[removeAtSignSuffix(atom->name())] = atom;
+ definedAtoms[removeStdcallSuffix(atom->name())] = atom;
std::set<PECOFFLinkingContext::ExportDesc> exports;
for (PECOFFLinkingContext::ExportDesc desc : ctx.getDllExports()) {
OpenPOWER on IntegriCloud