[PATCH] D76281: [obj2yaml] - Stop dumping an empty sh_info field for SHT_RELA/SHT_REL sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 06:52:31 PDT 2020


grimar created this revision.
grimar added reviewers: jhenderson, MaskRay.

`.rela.dyn` is a dynamic relocation section that normally has
no value in `sh_info` field.

The existent `elf-reladyn-section-shinfo.yaml` which tests this piece has issues:

1. It does not check the case when we have more than one `SHT_REL[A]` section with `sh_info == 0` in the object. Because of this it did not catch the issue. Currently we print an excessive "Info" field:

  - Name:            .rela.dyn
    Type:            SHT_RELA
    EntSize:         0x0000000000000018
  - Name:            .rel.dyn
    Type:            SHT_REL
    EntSize:         0x0000000000000010
    Info:            ' [1]'



2. It seems can be more generic. I've added a `rel-rela-section.yaml` instead.


https://reviews.llvm.org/D76281

Files:
  llvm/test/tools/obj2yaml/elf-reladyn-section-shinfo.yaml
  llvm/test/tools/obj2yaml/rel-rela-section.yaml
  llvm/tools/obj2yaml/elf2yaml.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76281.250753.patch
Type: text/x-patch
Size: 3231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200317/1081fd7b/attachment-0001.bin>


More information about the llvm-commits mailing list