[all-commits] [llvm/llvm-project] c14081: [llvm-readobj] Include section name of notes.

Jordan Rupprecht via All-commits all-commits at lists.llvm.org
Thu Mar 5 09:54:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c140810ea158074c97bff4d3bd66c0e06aed6d93
      https://github.com/llvm/llvm-project/commit/c140810ea158074c97bff4d3bd66c0e06aed6d93
  Author: Jordan Rupprecht <rupprecht at google.com>
  Date:   2020-03-05 (Thu, 05 Mar 2020)

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

  Log Message:
  -----------
  [llvm-readobj] Include section name of notes.

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.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D75647




More information about the All-commits mailing list