Skip to content

Commit 3cf0d06

Browse files
committed
[BOLT] Add comment about the chosen threshold
1 parent 82d3fcc commit 3cf0d06

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bolt/lib/Passes/PointerAuthCFIAnalyzer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ Error PointerAuthCFIAnalyzer::runOnFunctions(BinaryContext &BC) {
147147
<< format("(%.2lf%%)", IgnoredPercent)
148148
<< " because of CFI inconsistencies\n";
149149

150+
// Errors in the input are expected from two sources:
151+
// - compilers emitting incorrect CFIs. This happens more frequently with
152+
// older compiler versions, but it should not account for a large percentage.
153+
// - input binary is using synchronous unwind tables. This means that after
154+
// call sites, the unwind CFIs are dropped: the pass sees missing
155+
// .cfi_negate_ra_state from autiasp instructions. If this is the case, a
156+
// larger percentage of functions will be ignored.
157+
//
158+
// This is why the 10% threshold was chosen: we should not warn about
159+
// synchronous unwind tables if only a few % is ignored.
150160
if (IgnoredPercent >= 10.0)
151161
BC.outs() << "BOLT-WARNING: PointerAuthCFIAnalyzer only supports "
152162
"asynchronous unwind tables. For C compilers, see "

0 commit comments

Comments
 (0)