[llvm] [docs][llvm-readobj] Document the --call-graph-info output format (PR #227386)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 01:21:57 PDT 2026


================
@@ -16,3 +16,130 @@ Each record in the `.llvm.callgraph` section has the following binary layout:
 | Direct Callees Array                   | `uintptr_t[]` | Variable    | An array of unique direct callee entry point addresses. This field is only present if there is at least one direct callee. |
 | Number of Unique Indirect Target Type IDs| `ULEB128`     | Variable    | The number of unique indirect call target type IDs. This field is only present if there is at least one indirect target type ID. |
 | Indirect Target Type IDs Array         | `uint64_t[]`  | Variable    | An array of unique indirect call target type IDs. This field is only present if there is at least one indirect target type ID. |
+
+## Dumping with llvm-readobj
+
+`llvm-readobj --call-graph-info` prints the records of every `SHT_LLVM_CALL_GRAPH` section in a file. With `--elf-output-style=JSON`, the output is a `CallGraph` array that holds one `Function` object per record. The default `LLVM` output style prints the same fields, with addresses and type IDs in hexadecimal.
----------------
jh7370 wrote:

I'm not sure what the markdown syntax is for this, but references to options like --call-graph-info and --elf-output-style should ideally be links back to the Command Guide documentation for llvm-readobj.

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


More information about the llvm-commits mailing list