This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf] Fix core note descriptions
ClosedPublic

Authored by rupprecht on Aug 1 2019, 2:38 PM.

Details

Summary

Core files have different descriptions for note values. llvm-readelf currently prints the generic note type, which is wrong when using it to read a core file.

To verify the constants/strings, see:
Values: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=include/elf/common.h;h=75c4fb7e9d7c0f780d635ac305f579546b7b071b;hb=HEAD#l571
Strings: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/readelf.c;h=c31a5c1266b7bb62a485895b01b49e1f832ade35;hb=HEAD#l16881

Note: this does not handle printing the note data for NT_FILE, it just fixes the descriptions.

Diff Detail

Repository
rL LLVM

Event Timeline

rupprecht created this revision.Aug 1 2019, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2019, 2:38 PM
MaskRay added inline comments.Aug 1 2019, 9:12 PM
llvm/include/llvm/BinaryFormat/ELF.h
1367 ↗(On Diff #212909)

Sort the enum members?

(binutils-gdb and Linux uapi have different orders, but I don't see any problem if we just sort them and move NT_PRXFPREG below to be beside NT_FILE and NT_SIGINFO.

labath added a subscriber: labath.Aug 2 2019, 1:03 AM
rupprecht updated this revision to Diff 213078.Aug 2 2019, 10:19 AM
rupprecht marked an inline comment as done.
  • Sort enums by value and separate groups by whitespace
rupprecht updated this revision to Diff 213119.Aug 2 2019, 1:56 PM
  • Rearrange NT_ constants in ELFDumper to match ordering in libObject header
MaskRay accepted this revision.Aug 2 2019, 7:37 PM
This revision is now accepted and ready to land.Aug 2 2019, 7:37 PM
This revision was automatically updated to reflect the committed changes.