This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.
ClosedPublic

Authored by grimar on Nov 18 2019, 8:02 AM.

Details

Summary

Our elf-versioninfo.test is not perfect. It does not properly test how
flags are dumped and also we have a bug: they are dumped as enums in
LLVM style now, i.e not dumped properly.

GNU style uses a versionFlagToString method to build a string from flags
which seems is consistent with GNU readelf.

In this patch I fixed the issues mentioned.

Diff Detail

Event Timeline

grimar created this revision.Nov 18 2019, 8:02 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar updated this revision to Diff 229851.Nov 18 2019, 8:03 AM
  • Last minute fix.
grimar updated this revision to Diff 229853.Nov 18 2019, 8:13 AM
  • Seems I've forgot to fix a one of LLD tests. Now it is fixed.
ruiu accepted this revision.Nov 18 2019, 6:34 PM

LGTM

This revision is now accepted and ready to land.Nov 18 2019, 6:34 PM
MaskRay accepted this revision.Nov 19 2019, 3:08 PM

I agree that making the field an enumeration is an improvement, but I also feel that the closing bracket ] on a different line is a bit verbose.

Ideally we can make it on one line, e.g. Flags [], Flags [ Info (0x4), 0x8] (0x8 is an unspecified bit field. Bikeshedding on the representation welcomed!)

ruiu added a comment.Nov 19 2019, 6:04 PM

I agree that making the field an enumeration is an improvement, but I also feel that the closing bracket ] on a different line is a bit verbose.

Ideally we can make it on one line, e.g. Flags [], Flags [ Info (0x4), 0x8] (0x8 is an unspecified bit field. Bikeshedding on the representation welcomed!)

I agree with you that the new output looks a bit too verbose but I'd keep it consistent with other flags, as the output is in many cases consumed by programs than humans.

This revision was automatically updated to reflect the committed changes.