[all-commits] [llvm/llvm-project] a02b38: [obj2yaml] - SHT_DYNAMIC and SHT_REL* sections: st...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Thu Mar 19 07:26:15 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a02b38698b409c4bb93fc22782a769674c63e28f
      https://github.com/llvm/llvm-project/commit/a02b38698b409c4bb93fc22782a769674c63e28f
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-03-19 (Thu, 19 Mar 2020)

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

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

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`

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




More information about the All-commits mailing list