[PATCH] D87613: [llvm-readelf/obj] - Print section symbol names properly when dumping relocations.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 07:35:16 PDT 2020


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

Currently `--relocations` ignores section symbol names and always prints
section names for them. This is inconsistent with GNU readelf and with `--symbols`.

We have a code in `getFullSymbolName` (which is used for `--symbols`) which can be
reused for `getRelocationTarget` (used for `--relocations`).
With that the issue described is fixed and code becomes a bit shorter.
This is what this patch does.

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


https://reviews.llvm.org/D87613

Files:
  llvm/test/tools/llvm-objcopy/ELF/Inputs/compress-debug-sections.yaml
  llvm/test/tools/llvm-readobj/ELF/relocation-errors.test
  llvm/test/tools/llvm-readobj/ELF/section-symbols.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87613.291572.patch
Type: text/x-patch
Size: 13836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200914/9fa51adb/attachment.bin>


More information about the llvm-commits mailing list