diff options
Diffstat (limited to 'bolt/lib/Rewrite/RewriteInstance.cpp')
-rw-r--r-- | bolt/lib/Rewrite/RewriteInstance.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index c428828..a0e7995 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1514,6 +1514,12 @@ void RewriteInstance::registerFragments() { } if (BD) { BinaryFunction *BF = BC->getFunctionForSymbol(BD->getSymbol()); + if (BF == &Function) { + BC->errs() + << "BOLT-WARNING: fragment maps to the same function as parent: " + << Function << '\n'; + continue; + } if (BF) { BC->registerFragment(Function, *BF); continue; @@ -4005,10 +4011,12 @@ void RewriteInstance::mapCodeSections(BOLTLinker::SectionMapper MapSection) { BC->outs() << '\n'; AllocationDone = true; } else { - BC->errs() << "BOLT-WARNING: original .text too small to fit the new code" - << " using 0x" << Twine::utohexstr(opts::AlignText) - << " alignment. " << CodeSize << " bytes needed, have " - << BC->OldTextSectionSize << " bytes available.\n"; + BC->errs() << "BOLT-WARNING: --use-old-text failed. The original .text " + "too small to fit the new code using 0x" + << Twine::utohexstr(opts::AlignText) << " alignment. " + << CodeSize << " bytes needed, have " << BC->OldTextSectionSize + << " bytes available. Rebuilding without --use-old-text may " + "produce a smaller binary\n"; opts::UseOldText = false; } } |