This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Teach tool to report error if some section is in multiple COMDAT groups at once.
ClosedPublic

Authored by grimar on Sep 7 2017, 6:50 AM.

Details

Summary

This is relative to PR34506,
current LLD head produces broken output. It places the same section into 2 COMDAT groups.
gnu readelf tool reports an error in this case.

Patch teaches llvm-readobj to do the same.

Diff Detail

Event Timeline

grimar created this revision.Sep 7 2017, 6:50 AM
davide edited edge metadata.Sep 7 2017, 10:48 AM

We should really move away from a model where we check in a binary for the dumper output.
Can you try to write a YAML file to generate the same object? (I think mc won't do it).

grimar updated this revision to Diff 114362.Sep 8 2017, 7:36 AM
  • Used yaml2obj for producing testcase instead of using precompiled binary.

Note: there is patch for printGroupSections() refactoring on review, it is D37621,
it may make sence to land it first probably and rebase this one after that.

grimar updated this revision to Diff 115184.Sep 14 2017, 1:35 AM
  • Rebased after r313236.
grimar updated this revision to Diff 115386.Sep 15 2017, 3:29 AM
  • Print introduced error to stderr instead of stdout. This is consistent with GNU readelf behavior.
This revision was automatically updated to reflect the committed changes.