[PATCH] D75647: [llvm-readobj] Include section name of notes.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 14:37:59 PST 2020


rupprecht created this revision.
rupprecht added reviewers: MaskRay, jhenderson, grimar.
Herald added subscribers: llvm-commits, kerbowa, nhaehnle, jvesely, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.

This changes the output of `llvm-readelf -n` from:

  Displaying notes found at file offset 0x<...> with length 0x<...>:

to:

  Displaying notes found in: .note.foo

And similarly, adds a `Name:` field to the `llvm-readobj -n` output for notes.

This change not only increases GNU compatibility, it also makes it much easier to read notes. Note that we still fall back to printing the file offset/length in cases where we don't have a section name, such as when printing notes in program headers or printing notes in a partially stripped file (GNU readelf does the same).

Fixes llvm.org/PR41339.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75647

Files:
  lld/test/ELF/partition-notes.s
  llvm/test/CodeGen/AMDGPU/code-object-v3.ll
  llvm/test/tools/llvm-objcopy/ELF/add-note.test
  llvm/test/tools/llvm-readobj/ELF/AArch64/aarch64-note-gnu-property.s
  llvm/test/tools/llvm-readobj/ELF/all.test
  llvm/test/tools/llvm-readobj/ELF/gnu-note-size.test
  llvm/test/tools/llvm-readobj/ELF/gnu-notes.test
  llvm/test/tools/llvm-readobj/ELF/note-amd.s
  llvm/test/tools/llvm-readobj/ELF/note-amdgpu.test
  llvm/test/tools/llvm-readobj/ELF/note-freebsd.s
  llvm/test/tools/llvm-readobj/ELF/note-generic.s
  llvm/test/tools/llvm-readobj/ELF/note-gnu-property.s
  llvm/test/tools/llvm-readobj/ELF/note-gnu-property2.s
  llvm/test/tools/llvm-readobj/ELF/note-unknown.s
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75647.248317.patch
Type: text/x-patch
Size: 21331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200304/1933d089/attachment.bin>


More information about the llvm-commits mailing list