This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml,yaml2obj] - Fix issues with creating/dumping group sections.
ClosedPublic

Authored by grimar on Dec 28 2020, 1:32 AM.

Details

Summary

We have the following issues related to group sections:

  1. yaml2obj is unable to set the custom sh_entsize value, because the EntSize key is currently ignored.
  2. obj2yaml is unable to dump the group section which sh_entsize != 4.
  3. obj2yaml always dumps the "EntSize" for group sections, though usually we are trying to omit dumping default values when dumping keys. I.e. we should not print the "EntSize" key when sh_entsize == 4.

This patch fixes (1),(3) and adds the test case to document the behavior of (2).

Depends on D93753

Diff Detail

Event Timeline

grimar created this revision.Dec 28 2020, 1:32 AM
grimar requested review of this revision.Dec 28 2020, 1:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 28 2020, 1:32 AM
MaskRay accepted this revision.Dec 28 2020, 10:38 PM
This revision is now accepted and ready to land.Dec 28 2020, 10:38 PM

Seems to me like you should have a dedicate yaml2obj test that shows the sh_entsize can be set for group sections?

grimar updated this revision to Diff 315766.Jan 11 2021, 5:19 AM
  • Added dedicated yaml2obj test.