summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2/llvm-lto2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-lto2/llvm-lto2.cpp')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index 0bd9289dc93..0adb048b18e 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -291,6 +291,14 @@ static int run(int argc, char **argv) {
std::vector<SymbolResolution> Res;
for (const InputFile::Symbol &Sym : Input->symbols()) {
auto I = CommandLineResolutions.find({F, Sym.getName()});
+ // If it isn't found, look for "$", which would have been added
+ // (followed by a hash) when the symbol was promoted during module
+ // splitting if it was defined in one part and used in the other.
+ // Try looking up the symbol name before the "$".
+ if (I == CommandLineResolutions.end()) {
+ auto SplitName = Sym.getName().rsplit("$");
+ I = CommandLineResolutions.find({F, SplitName.first});
+ }
if (I == CommandLineResolutions.end()) {
llvm::errs() << argv[0] << ": missing symbol resolution for " << F
<< ',' << Sym.getName() << '\n';
OpenPOWER on IntegriCloud