[PATCH] D129924: [llvm-objdump] Support --symbolize-operands when there is a single SHT_LLVM_BB_ADDR_MAP section for all text sections.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 12:59:11 PDT 2022


MaskRay accepted this revision.
MaskRay added a comment.

The subject line usually doesn't have the trailing period.

A SHT_LLVM_BB_ADDR_MAP section does not have SHF_ALLOC. One such section referencing multiple text sections is fine. If a referenced text section is discarded (e.g. due to --gc-sections), the relocated location in SHT_LLVM_BB_ADDR_MAP will be zero.



================
Comment at: llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml:114
             Metadata:      0x2
+  - Name:   bb_addr_map.bar
+    Type:   SHT_LLVM_BB_ADDR_MAP
----------------
If the preferred name is `.llvm_bb_addr_map*`, better to use it for most tests. You may keep one using a different name to check that the section name doesn't matter.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:1282
+  std::unordered_map<uint64_t, BBAddrMap> AddrToBBAddrMap;
+
+  auto ReadBBAddrMap = [&](Optional<unsigned> SectionIndex = None) {
----------------
llvm style doesn't add a blank line after a variable declaration.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129924/new/

https://reviews.llvm.org/D129924



More information about the llvm-commits mailing list