[PATCH] D143841: [Propeller] Make decoding BBAddrMaps trace through relocations

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 11 23:25:45 PST 2023


aidengrossman created this revision.
Herald added subscribers: hiraditya, emaste.
Herald added a reviewer: jhenderson.
Herald added a reviewer: MaskRay.
Herald added a project: All.
aidengrossman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently when using the LLVM tools (eg llvm-readobj, llvm-objdump) to
find information about basic block locations using the propeller tooling
in relocatable object files function addresses are not mapped properly
which causes problems. In llvm-readobj this means that incorrect
function names will be pulled. In llvm-objdum this means that most BBs
won't show up in the output if --symbolize-operands is used. This patch
changes the behavior of decodeBBAddrMap to trace through relocations
to get correct function addresses if it is going through a relocatable
object file. This fixes the behavior in both tools and also other
consumers of decodeBBAddrMap. Some helper functions have been added
in/refactoring done to aid in grabbing BB address map sections now that
in some cases both relocation and BB address map sections need to be
obtained at the same time.

Regression tests moved around/added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143841

Files:
  llvm/include/llvm/Object/ELF.h
  llvm/lib/Object/ELF.cpp
  llvm/lib/Object/ELFObjectFile.cpp
  llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-disassemble-symbolize-operands.yaml
  llvm/test/tools/llvm-objdump/X86/elf-bbaddrmap-symbolize-relocatable.yaml
  llvm/test/tools/llvm-readobj/ELF/bb-addr-map-relocatable.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143841.496741.patch
Type: text/x-patch
Size: 21438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230212/da19dc58/attachment.bin>


More information about the llvm-commits mailing list