diff options
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 1db7bd92a4a0..2cac9d74b83e 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -3108,6 +3108,10 @@ void RewriteInstance::emitAndLink() { emitBinaryContext(*Streamer, *BC, getOrgSecPrefix()); Streamer->Finish(); + if (Streamer->getContext().hadError()) { + errs() << "BOLT-ERROR: Emission failed.\n"; + exit(1); + } ////////////////////////////////////////////////////////////////////////////// // Assign addresses to new sections. @@ -3137,7 +3141,7 @@ void RewriteInstance::emitAndLink() { RTDyld->finalizeWithMemoryManagerLocking(); if (RTDyld->hasError()) { - outs() << "BOLT-ERROR: RTDyld failed: " << RTDyld->getErrorString() << "\n"; + errs() << "BOLT-ERROR: RTDyld failed: " << RTDyld->getErrorString() << "\n"; exit(1); } |