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

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 07:46:21 PST 2025


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

>From 321c3cef31508b06276b9fd0524724d89200e57f Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 9 Dec 2025 15:39:22 +0000
Subject: [PATCH 1/2] [BOLT][docs] Add commands to identify BOLT-ed binaries

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.
---
 bolt/README.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

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).

>From 2f39d8bcae0ee6dfdc9289517bd6715dcbc8d829 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 9 Dec 2025 15:45:55 +0000
Subject: [PATCH 2/2] Use readelf only. Anyone who knows what llvm-readelf is
 can figure that out themselves.

---
 bolt/README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bolt/README.md b/bolt/README.md
index 3544f58e0d580..e578227e8cd12 100644
--- a/bolt/README.md
+++ b/bolt/README.md
@@ -209,14 +209,14 @@ have extra sections with `bolt` in their name.
 
 You can use `readelf` to find these:
 ```
-$ llvm-readelf -S <your-binary> | grep bolt
+$ 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>
+$ readelf -n <your-binary>
 <...>
 Displaying notes found in: .note.bolt_info
   <...>



More information about the llvm-commits mailing list