[PATCH] D71462: [llvm-readelf][llvm-readobj] - Reimplement the logic of section flags dumping.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 05:31:00 PST 2019


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay, rupprecht.
Herald added subscribers: seiya, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D71462

Files:
  llvm/test/tools/llvm-objcopy/ELF/rename-section-flag-osproc-mask.test
  llvm/test/tools/llvm-readobj/ELF/section-arch-flags.test
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71462.233785.patch
Type: text/x-patch
Size: 9024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191213/e38394a3/attachment.bin>


More information about the llvm-commits mailing list