[PATCH] D76227: [obj2yaml] - SHT_DYNAMIC and SHT_REL* sections: stop dumping sh_entsize field when it has the default value.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 05:52:28 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.
Herald added subscribers: kbarton, nemanjai.
grimar edited the summary of this revision.
Herald added a subscriber: wuzish.

Currently obj2yaml always emits the `EntSize` property when `sh_entsize != 0`.
It is not correct. For example, for `SHT_DYNAMIC` section, `EntSize == 0`
is abnormal, while `sizeof(ELFT::Dyn)` is the expected default.

To reduce the output produces we should not dump default values.

yaml2obj tests that shows `sh_entsize` values produced are:

1. For `SHT_REL*` sections: `yaml2obj\ELF\reloc-sec-entry-size.yaml`
2. For `SHT_DYNAMIC`: `yaml2obj\ELF\dynamic-section.yaml` (See D76226 <https://reviews.llvm.org/D76226>)


https://reviews.llvm.org/D76227

Files:
  llvm/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
  llvm/test/Object/obj2yaml.test
  llvm/test/tools/obj2yaml/dynamic-section.test
  llvm/test/tools/obj2yaml/elf-ppc64-relocations.yaml
  llvm/test/tools/obj2yaml/elf-reladyn-section-shinfo.yaml
  llvm/test/tools/obj2yaml/no-symbol-reloc.test
  llvm/test/tools/obj2yaml/relocation-type.yaml
  llvm/test/tools/obj2yaml/relr-section.yaml
  llvm/tools/obj2yaml/elf2yaml.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76227.250541.patch
Type: text/x-patch
Size: 8334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200316/1fb0b0cd/attachment.bin>


More information about the llvm-commits mailing list