[PATCH] D117642: [XCOFF][llvm-objdump] ignore the default .text symbol during dissembling.

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 00:03:33 PST 2022


Esme created this revision.
Esme added reviewers: jsji, shchenz, jhenderson, Higuoxing, DiggerLin, PowerPC.
Herald added subscribers: rupprecht, nemanjai.
Herald added a reviewer: MaskRay.
Esme requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The default .text is a special symbol for a XCOFF text section. It doesn't bind to code locations and is irrelevant for disassembly.
It causes incorrect output of the first symbol name in text section under `llvm-objdump -d`. 
For example, here is a scenario where the text section has three symbols, i.e.

  00000000 .text
  00000000 .foo1
  0000001c .foo2

We will sort these symbols and get a new sequence, i.e.

  00000000 .foo1
  00000000 .text
  0000001c .foo2

Finally, we will get an output as shown below.

  00000000 <.text>: // <.foo1> is expected.
  ...
  0000001c <.foo2>:
  ...

This patch removes the default .text symbol.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117642

Files:
  llvm/test/CodeGen/PowerPC/aix-prefixed-instruction-boundary.mir
  llvm/test/CodeGen/PowerPC/aix-return55.ll
  llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir
  llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-textdisassembly.ll
  llvm/test/tools/llvm-objdump/XCOFF/disassemble-all.test
  llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-description.test
  llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbolize-operands.ll
  llvm/test/tools/llvm-objdump/XCOFF/print-linenumber.test
  llvm/tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117642.401099.patch
Type: text/x-patch
Size: 7946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/a0857709/attachment.bin>


More information about the llvm-commits mailing list