[llvm] [llvm-readobj] Dump callgraph section info for ELF (PR #157499)

Prabhu Rajasekaran via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 11:55:52 PST 2025


================
@@ -0,0 +1,26 @@
+## Tests that --call-graph-info fails if .llvm.callgraph section does not have
+## an expected value, e.g., not as much call sites as the given count.
+
+# REQUIRES: x86-registered-target
+
+# RUN: llvm-mc %s -filetype=obj -triple=x86_64-pc-linux -o %t
+# RUN: not llvm-readelf --call-graph-info %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=ERR
+# RUN: not llvm-readelf --elf-output-style=LLVM --call-graph-info %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=ERR
+# RUN: not llvm-readelf --elf-output-style=JSON --pretty-print --call-graph-info %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=ERR
+
+# ERR: error: 'While reading call graph info's [indirect type ID] for function at [0x0]': unexpected end of data at offset 0x13 while reading [0x13, 0x1b)
+
+.text
+.globl _Z3foov
+.type _Z3foov, at function
+_Z3foov:
+ callq _Z3foov at PLT
----------------
Prabhuk wrote:

Done.

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


More information about the llvm-commits mailing list