[PATCH] D156190: [llvm-objdump] -d: don't display mapping symbols as labels

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 17:31:12 PDT 2023


MaskRay created this revision.
MaskRay added reviewers: jhenderson, jobnoorman, peter.smith, simon_tatham.
Herald added a subscriber: emaste.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Similar to D96617 <https://reviews.llvm.org/D96617> for llvm-symbolizer.

GNU objdump -d does not display mapping symbols as labels. Mapping
symbol names don't convey much information. If a map symbol has the same
value as another symbol, we want to display the other symbol. This patch
matches the GNU behavior.

When --show-all-symbols is specified, we place mapping symbols in `AllSymbols`
as well, so that they are still printed (`multiple-symbols.s`).

The main complexity is that mapping symbols are currently searched
within `AllSymbols`.

Data items are displayed as `.byte`/`.short`/`.word`, making mapping
symbol labels even less useful.

20+ lld/test/ELF tests are affected. I have only fixed some to
demonstrate the changed behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156190

Files:
  lld/test/ELF/aarch64-cortex-a53-843419-large.s
  lld/test/ELF/arm-bl-v4.s
  lld/test/ELF/arm-gnu-ifunc.s
  lld/test/ELF/arm-got-relative.s
  lld/test/ELF/arm-plt-reloc.s
  lld/test/ELF/arm-thumb-plt-range-thunk-os.s
  llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.s
  llvm/test/tools/llvm-objdump/ELF/AArch64/elf-aarch64-mapping-symbols.test
  llvm/tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156190.543758.patch
Type: text/x-patch
Size: 20141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230725/4bb45a75/attachment.bin>


More information about the llvm-commits mailing list