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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 08:59:45 PST 2019


jhenderson added a comment.

In D58615#1409166 <https://reviews.llvm.org/D58615#1409166>, @Higuoxing wrote:

> In D58615#1409090 <https://reviews.llvm.org/D58615#1409090>, @jhenderson wrote:
>
> > 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?
>
>
> I think there could be an object file that has over 10 entries in its `verdef` section.
>  However, `gnu-objdump` has the same problem. I currently have no idea how to make it compatible with `gnu-objdump` and ensure the column width is consistent.


In general, we have not been aiming to be output-identical to GNU tools, but to be similar enough so that the output is clear. Where there are clear improvements to be had, we have done so. As such, I don't think you need to match GNU objdump's output byte for byte here. I would recommend left-padding the index column with spaces as needed. As for the aux fields, I would pad it so that it lines up exactly with the name above it.


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