[all-commits] [llvm/llvm-project] c1f87d: Refactored getSectionAndRelocations

Aiden Grossman via All-commits all-commits at lists.llvm.org
Sat Feb 25 02:41:36 PST 2023


  Branch: refs/heads/propeller-relocs-stack-2
  Home:   https://github.com/llvm/llvm-project
  Commit: c1f87dca0e8e13964ccd04718792da5cf4b3ca49
      https://github.com/llvm/llvm-project/commit/c1f87dca0e8e13964ccd04718792da5cf4b3ca49
  Author: Aiden Grossman <agrossman154 at yahoo.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M llvm/include/llvm/Object/ELF.h
    M llvm/lib/Object/ELF.cpp
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  Refactored getSectionAndRelocations


  Commit: d77d2b71558dd8de68c8d718a2dca17c1704b661
      https://github.com/llvm/llvm-project/commit/d77d2b71558dd8de68c8d718a2dca17c1704b661
  Author: Aiden Grossman <agrossman154 at yahoo.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

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

  Log Message:
  -----------
  [Propeller] Make decoding BBAddrMaps trace through relocations

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.

Differential Revision: https://reviews.llvm.org/D143841


Compare: https://github.com/llvm/llvm-project/compare/c1f87dca0e8e%5E...d77d2b71558d


More information about the All-commits mailing list