[llvm] r214925 - [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify

Lang Hames lhames at gmail.com
Tue Aug 5 13:51:47 PDT 2014


Author: lhames
Date: Tue Aug  5 15:51:46 2014
New Revision: 214925

URL: http://llvm.org/viewvc/llvm-project?rev=214925&view=rev
Log:
[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.


Modified:
    llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp

Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=214925&r1=214924&r2=214925&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Tue Aug  5 15:51:46 2014
@@ -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) {





More information about the llvm-commits mailing list