[PATCH] D58701: [llvm-readobj] Print section type values for unknown sections.

Matt Davis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 26 16:57:33 PST 2019


mattd created this revision.
mattd added reviewers: jhenderson, rupprecht.
Herald added subscribers: jdoerfert, srhines.
Herald added a project: LLVM.

This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections.

Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table).
Section Headers:

  [Nr] Name              Type
  [16] android_rel       LOOS+0x1
  [17] android_rela      LOOS+0x2
  [27] unknown           0x1000: <unknown>
  [28] loos              LOOS+0
  [30] hios              VERSYM
  [31] loproc            LOPROC+0
  [33] hiproc            LOPROC+0xFFFFFFF
  [34] louser            LOUSER+0
  [36] hiuser            LOUSER+0x7FFFFFFF

As a comparison, the previous output looked something like the above, but with a blank "Type" field:

  [Nr] Name              Type
  [27] unknown
  [28] loos
  [30] hios              VERSYM
  [31] loproc
  [33] hiproc
  [34] louser
  [36] hiuser

This fixes PR40773


https://reviews.llvm.org/D58701

Files:
  llvm/test/tools/llvm-readobj/elf-section-types.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58701.188481.patch
Type: text/x-patch
Size: 4525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190227/d16bf9b8/attachment.bin>


More information about the llvm-commits mailing list