Page MenuHomePhabricator

[llvm-objdump] Annotate symbol names under `--symbolize-operands`.
Needs ReviewPublic

Authored by Esme on Jan 16 2022, 6:13 PM.

Details

Reviewers
shchenz
jsji
jhenderson
Higuoxing
MaskRay
Group Reviewers
Restricted Project
Summary

We would like to disassemble an object file and annotate it with the variables that are being accessed.
This patch achieves the feature by walking through the relocations and annotate instructions with their target symbol names.

Diff Detail

Event Timeline

Esme created this revision.Jan 16 2022, 6:13 PM
Esme requested review of this revision.Jan 16 2022, 6:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2022, 6:13 PM

To access the relocation information, I'd prefer that the user specifies -r:

88: 01 00 00 48   bl 0x88 <foo+0x48>
          0000000000000088:  R_PPC64_REL24        extern

Without the relocation type information, the 4 addend for R_PPC64_REL16_LO may be confusing.

; CHECK-NEXT:     c4:       addi 2, 2, 0                    #  <.TOC.+0x4>

PS: ET_EXEC/ET_DYN PowerPC binary has the problem described by https://reviews.llvm.org/D116677#3239375 . If you want to contribute to this area...