[PATCH] D58615: [llvm-objdump] Add `Version Definitions` dumper

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 07:49:46 PST 2019


jhenderson added a comment.

How many verdefs do you get in a typical file? I'm looking at the hard-coded indentation amount of Verdaux entries after the first, and thinking that that indentation doesn't look quite right, and would look worse the higher the index, due to the first column changing in width. I think it should line up with the previous name, but I don't think it currently does. Additionally, if I'm not mistaken the formatting will look something like:

  1 0x01 0x075bcd15 foo
  2 0x02 0x3ade68b1 VERSION_1
  ...
  9 0xab 0x12345678 something
  10 0xdc 0xabcdef90 something_else

which doesn't look great. Assuming it's not unusual to have 10+ entries, could you do something that ensures the column width is consistent?



================
Comment at: tools/llvm-objdump/ELFDump.cpp:314
+    outs() << VerdefIndex ++ << " "
+           << format("0x%02" PRIx16 " ", (uint16_t)Verdef->vd_flags)
+           << format("0x%08" PRIx32 " ", (uint32_t)Verdef->vd_hash);
----------------
This only prints a width of 2, but the flags could require four digits. Are there never any flags beyond 0xff?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58615/new/

https://reviews.llvm.org/D58615





More information about the llvm-commits mailing list