HomePhabricator

[llvm-readobj] Include section name of notes.

Authored by rupprecht on Mar 4 2020, 2:20 PM.

Description

[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

Details

Committed
rupprechtMar 5 2020, 9:53 AM
Reviewer
MaskRay
Differential Revision
D75647: [llvm-readobj] Include section name of notes.
Parents
rGc93f1046fc15: [X86/MC] Factor out common code [NFC]
Branches
Unknown
Tags
Unknown