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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 07:43:56 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: rupprecht, atanasyan, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
grimar requested review of this revision.

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.

Depends on D87763 <https://reviews.llvm.org/D87763>


https://reviews.llvm.org/D87764

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87764.292218.patch
Type: text/x-patch
Size: 15663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200916/c5841e9b/attachment.bin>


More information about the llvm-commits mailing list