[llvm] [BOLT][docs] Add commands to identify BOLT-ed binaries (PR #171458)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 07:42:30 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

These have been useful to me in the past and I don't see any docs referencing the `bolt_info` note either.

There is a test checking that it is emitted, so I assume it's something we are ok with people looking for.

---
Full diff: https://github.com/llvm/llvm-project/pull/171458.diff


1 Files Affected:

- (modified) bolt/README.md (+21) 


``````````diff
diff --git a/bolt/README.md b/bolt/README.md
index 55f742c5019f5..3544f58e0d580 100644
--- a/bolt/README.md
+++ b/bolt/README.md
@@ -202,6 +202,27 @@ $ merge-fdata *.fdata > combined.fdata
 Use `combined.fdata` for **Step 3** above to generate a universally optimized
 binary.
 
+## Identifying a Binary Modified By BOLT
+
+A binary that has been modified by BOLT will include a `bolt_info` note and may
+have extra sections with `bolt` in their name.
+
+You can use `readelf` to find these:
+```
+$ llvm-readelf -S <your-binary> | grep bolt
+  [11] .bolt.org.eh_frame PROGBITS <...>
+<...>
+  [39] .note.bolt_info   NOTE <...>
+```
+The note can be displayed with:
+```
+$ llvm-readelf -n <your-binary>
+<...>
+Displaying notes found in: .note.bolt_info
+  <...>
+    Version: BOLT revision: <...>
+```
+
 ## License
 
 BOLT is licensed under the [Apache License v2.0 with LLVM Exceptions](./LICENSE.TXT).

``````````

</details>


https://github.com/llvm/llvm-project/pull/171458


More information about the llvm-commits mailing list