This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by grimar on Mar 17 2020, 6:41 AM.

Details

Summary

.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]'
  1. It seems can be more generic. I've added a rel-rela-section.yaml instead.

Diff Detail

Event Timeline

grimar created this revision.Mar 17 2020, 6:41 AM
jhenderson accepted this revision.Mar 19 2020, 2:56 AM

LGTM.

llvm/test/tools/obj2yaml/rel-rela-section.yaml
31–34

I'm fine either way, but can't this be simply DynamicSymbols: []? I thought that created a dynsym with the null symbol in only?

This revision is now accepted and ready to land.Mar 19 2020, 2:56 AM
grimar marked an inline comment as done.Mar 19 2020, 3:43 AM
grimar added inline comments.
llvm/test/tools/obj2yaml/rel-rela-section.yaml
31–34

Right. Seems I've forgot to clean-up this piece that comes from the test I am removing.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2020, 4:17 AM