diff options
| author | Rui Ueyama <ruiu@google.com> | 2014-05-01 22:44:42 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2014-05-01 22:44:42 +0000 |
| commit | efa8076c29f8306f3b683d9423e0164e9c9af870 (patch) | |
| tree | 140bf28f71c719dbda4f0e1eb6b4fe0c01c0502f /lld/lib/ReaderWriter | |
| parent | 1f03d08a8c103a3bc5de93e4f5e394c6f5ffbf1d (diff) | |
| download | bcm5719-llvm-efa8076c29f8306f3b683d9423e0164e9c9af870.tar.gz bcm5719-llvm-efa8076c29f8306f3b683d9423e0164e9c9af870.zip | |
[PECOFF] Drop stdcall's atsign suffix only.
You can omit @number suffix when specifying /export option,
but you can do that only for stdcall functions.
llvm-svn: 207809
Diffstat (limited to 'lld/lib/ReaderWriter')
| -rw-r--r-- | lld/lib/ReaderWriter/PECOFF/EdataPass.cpp | 6 |
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()) { |

