[all-commits] [llvm/llvm-project] 541daa: [llvm-readelf][llvm-readobj] - Reimplement the log...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Tue Dec 17 23:53:30 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 541daa5e6b9bc38986e09612a9bd6f0f148fdfcf
      https://github.com/llvm/llvm-project/commit/541daa5e6b9bc38986e09612a9bd6f0f148fdfcf
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2019-12-18 (Wed, 18 Dec 2019)

  Changed paths:
    M llvm/test/tools/llvm-objcopy/ELF/rename-section-flag-osproc-mask.test
    M llvm/test/tools/llvm-readobj/ELF/section-arch-flags.test
    A llvm/test/tools/llvm-readobj/ELF/section-flags-os-proc.test
    M llvm/test/tools/llvm-readobj/ELF/section-flags.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readelf][llvm-readobj] - Reimplement the logic of section flags dumping.

Our logic that dumped the flags was buggy.

For LLVM style it dumped SHF_MASKPROC/SHF_MASKOS named constants, though
they are not flags, but masks.

For GNU style it was just very inconsistent with GNU which has logic
that is not straightforward. Imagine we have sh_flags == 0x90000000.
SHF_EXCLUDE ("E") has a value of 0x80000000 and SHF_MASKPROC is 0xf0000000.
GNU readelf will not print "E" or "Ep" in this case, but will print just
"p". It only will print "E" when no other processor flag is set.
I had to investigate the GNU source to find the algorithm and now our logic should
match it.

Differential revision: https://reviews.llvm.org/D71462




More information about the All-commits mailing list