From 264a325a90f7b397b8c9ff954080ffc73c9e2483 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 11 Sep 2014 23:09:22 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217643 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 49234f59b0b..dad02dca531 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -825,7 +825,10 @@ std::pair RuntimeDyldCheckerImpl::getStubAddrFor( 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; -- 2.34.1