[PATCH] D65140: [yaml2obj] - Allow custom fields for the SHT_UNDEF sections.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 01:15:43 PDT 2019


MaskRay added a comment.

In D65140#1600527 <https://reviews.llvm.org/D65140#1600527>, @grimar wrote:

> What about if we add something like "FIle size: <x>" field to the llvm-readobj?
> Like:
>
> ~/LLVM/build/bin/llvm-readobj test.ooo
>  File: test.ooo
>  **FIle size: XXX**
>  Format: ELF64-x86-64
>  Arch: x86_64
>  AddressSize: 64bit
>  LoadName: <Not found>


Ah sorry I missed the use of `stat` in the patch.

I'm not sure if we want to append `FIle size:` to the llvm-readobj output - it isn't an ELF field.

If you just want to check the size of a file, just use `ls -l`. As POSIX says:

> If the -l option is specified, the following information shall be written for files other than character special and block special files:



  "%s %u %s %s %u %s %s\n", <file mode>, <number of links>,
      <owner name>, <group name>, <size>, <date and time>,
      <pathname>

You can just use `ls -l %t | cut -d ' ' -f 5` to retrieve the size field.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65140





More information about the llvm-commits mailing list