[all-commits] [llvm/llvm-project] 095f6f: [llvm-readelf/obj] - Stop printing invalid names f...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Mon Sep 21 03:06:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 095f6fbbd7b61af205d761f6951a869ec4a61722
      https://github.com/llvm/llvm-project/commit/095f6fbbd7b61af205d761f6951a869ec4a61722
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-09-21 (Mon, 21 Sep 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
    M llvm/test/tools/llvm-readobj/ELF/hash-symbols.test
    M llvm/test/tools/llvm-readobj/ELF/mips-got.test
    M llvm/test/tools/llvm-readobj/ELF/mips-plt.test
    M llvm/test/tools/llvm-readobj/ELF/symbol-shndx.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readelf/obj] - Stop printing invalid names for unnamed section symbols.

We have an issue with `ELFDumper<ELFT>::getSymbolSectionName`:
1) It is used deeply for both LLVM/GNU styles and might return LLVM-style only
   values to describe symbols: "Undefined", "Processor Specific", "Absolute", etc.

2) `getSymbolSectionName` is used by `getFullSymbolName` and these special values
   might appear instead of symbol names in many places.
   This occurs for unnamed section symbols currently.

This patch extracts the LLVM specific logic to `LLVMStyle<ELFT>::printSymbolSection`,
which seems to be the only place where we want to print the special values mentioned.
It also adds a meaningful new warning that is reported when we are unable to get
a section index for a section symbol.

Differential revision: https://reviews.llvm.org/D87764




More information about the All-commits mailing list