[llvm] r217643 - [MCJIT] Improve the "stub not found" diagnostic in RuntimeDyldChecker.

Lang Hames lhames at gmail.com
Thu Sep 11 16:09:22 PDT 2014


Author: lhames
Date: Thu Sep 11 18:09:22 2014
New Revision: 217643

URL: http://llvm.org/viewvc/llvm-project?rev=217643&view=rev
Log:
[MCJIT] Improve the "stub not found" diagnostic in RuntimeDyldChecker.

A "stub found found" diagnostic is emitted when RuntimeDyldChecker's stub lookup
logic fails to find the requested stub. The obvious reason for the failure is
that no such stub has been created, but it can also fail for internal symbols if
the symbol offset is not computed correctly (E.g. due to a mangled relocation
addend). This patch adds a comment about the latter case so that it's not
overlooked.

Inspired by confusion experienced during test case construction for r217635.


Modified:
    llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp

Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp?rev=217643&r1=217642&r2=217643&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp Thu Sep 11 18:09:22 2014
@@ -825,7 +825,10 @@ std::pair<uint64_t, std::string> Runtime
   auto StubOffsetItr = SymbolStubs.find(SymbolName);
   if (StubOffsetItr == SymbolStubs.end())
     return std::make_pair(0,
-                          ("Symbol '" + SymbolName + "' not found.\n").str());
+                          ("Stub for symbol '" + SymbolName + "' not found. "
+                           "If '" + SymbolName + "' is an internal symbol this "
+                           "may indicate that the stub target offset is being "
+                           "computed incorrectly.\n").str());
 
   uint64_t StubOffset = StubOffsetItr->second;
 





More information about the llvm-commits mailing list