[PATCH] D65847: [llvm-readelf] --notes: move 'Data size' column left by 1

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 04:31:31 PDT 2019


MaskRay added a comment.

In D65847#1618571 <https://reviews.llvm.org/D65847#1618571>, @jhenderson wrote:

> In D65847#1618471 <https://reviews.llvm.org/D65847#1618471>, @MaskRay wrote:
>
> > In D65847#1618466 <https://reviews.llvm.org/D65847#1618466>, @jhenderson wrote:
> >
> > > LGTM. I assume that the 64-bit note layout (i.e. one with a 64-bit size field) works too?
> >
> >
> > binutils/readelf.c
> >
> > >   printf (_("  %-20s %10s\tDescription\n"), _("Owner"), _("Data size"));
> >
> > I think it is very unlikely that the size is larger than 32-bit...
>
>
> I agree a large size is unlikely. I was more concerned with it adding leading zeroes (correctly/incorrectly) for 64-bit numbers if the format was 64-bits. That broke the layout of some other tools, if I remember correctly.




  typedef struct
  {
    Elf64_Word n_namesz;			/* Length of the note's name.  */
    Elf64_Word n_descsz;			/* Length of the note's descriptor.  */
    Elf64_Word n_type;			/* Type of the note.  */
  } Elf64_Nhdr;

We don't have to worry about that. `n_descsz` is 32-bit in both ELFCLASS32 and ELFCLASS64.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65847





More information about the llvm-commits mailing list