From: Lang Hames Date: Tue, 5 Aug 2014 20:51:46 +0000 (+0000) Subject: [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=416ea4bfa71642c9a2c2f378ae9380406cdba1f7;p=oota-llvm.git [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify mode. This will cause -verify mode to report failure when RuntimeDyld encounters an internal error (e.g. overflows in relocation computations). Previously we had let these errors slip past unreported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214925 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 9de4d9e0a7d..f626a56cbb1 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -439,7 +439,14 @@ static int linkAndVerify() { // Resolve all the relocations we can. Dyld.resolveRelocations(); - return checkAllExpressions(Checker); + int ErrorCode = checkAllExpressions(Checker); + if (Dyld.hasError()) { + errs() << "RTDyld reported an error applying relocations:\n " + << Dyld.getErrorString() << "\n"; + ErrorCode = 1; + } + + return ErrorCode; } int main(int argc, char **argv) {