summaryrefslogtreecommitdiff
path: root/bolt/lib/Passes/PatchEntries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Passes/PatchEntries.cpp')
-rw-r--r--bolt/lib/Passes/PatchEntries.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/bolt/lib/Passes/PatchEntries.cpp b/bolt/lib/Passes/PatchEntries.cpp
index aae6634c6064..55f7513615e7 100644
--- a/bolt/lib/Passes/PatchEntries.cpp
+++ b/bolt/lib/Passes/PatchEntries.cpp
@@ -36,21 +36,17 @@ Error PatchEntries::runOnFunctions(BinaryContext &BC) {
if (!opts::ForcePatch) {
// Mark the binary for patching if we did not create external references
// for original code in any of functions we are not going to emit.
- bool NeedsPatching =
- llvm::any_of(llvm::make_second_range(BC.getBinaryFunctions()),
- [&](BinaryFunction &BF) {
- return (!BF.isPseudo() && !BC.shouldEmit(BF) &&
- !BF.hasExternalRefRelocations()) ||
- BF.needsPatch();
- });
+ bool NeedsPatching = llvm::any_of(
+ llvm::make_second_range(BC.getBinaryFunctions()),
+ [&](BinaryFunction &BF) {
+ return (!BC.shouldEmit(BF) && !BF.hasExternalRefRelocations()) ||
+ BF.needsPatch();
+ });
if (!NeedsPatching)
return Error::success();
}
- assert(!opts::UseOldText &&
- "Cannot patch entries while overwriting original .text");
-
if (opts::Verbosity >= 1)
BC.outs() << "BOLT-INFO: patching entries in original code\n";