[llvm] [llvm-readobj] Dump callgraph section info for ELF (PR #157499)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 24 00:32:17 PST 2025
================
@@ -5263,6 +5299,181 @@ template <class ELFT> void GNUELFDumper<ELFT>::printCGProfile() {
OS << "GNUStyle::printCGProfile not implemented\n";
}
+namespace callgraph {
+LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
+enum Flags : uint8_t {
+ None = 0,
+ IsIndirectTarget = 1u << 0,
+ HasDirectCallees = 1u << 1,
+ HasIndirectCallees = 1u << 2,
+ LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue*/ HasIndirectCallees)
+};
+} // namespace callgraph
+
+template <class ELFT> bool ELFDumper<ELFT>::processCallGraphSection() {
+ const Elf_Shdr *CGSection = findSectionByName(".llvm.callgraph");
----------------
jh7370 wrote:
Is .llvm.callgraph a new section, or a long pre-existing section that we're just gaining functionality to dump now? If it's new, a much-preferred approach would be to give the section a specific type, as type lookup is more appropriate for ELF than name lookup (and much faster, especially in large objects).
https://github.com/llvm/llvm-project/pull/157499
More information about the llvm-commits
mailing list