Skip to content

Commit

Permalink
[BOLT] Detect and reject binaries built for coverage.
Browse files Browse the repository at this point in the history
Summary: Don't attempt to optimize binaries built with coverage support.

(cherry picked from FBD4810330)
  • Loading branch information
maksfb committed Mar 31, 2017
1 parent c166a8c commit f7d32f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bolt/RewriteInstance.cpp
Expand Up @@ -837,6 +837,11 @@ void RewriteInstance::discoverFileObjects() {
"support. Cannot optimize.\n";
exit(1);
}
if (NameOrError && NameOrError->startswith("__llvm_coverage_mapping")) {
errs() << "BOLT-ERROR: input file was compiled or linked with coverage "
"support. Cannot optimize.\n";
exit(1);
}

if (Symbol.getFlags() & SymbolRef::SF_Undefined)
continue;
Expand Down

0 comments on commit f7d32f7

Please sign in to comment.