This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Test PPC64 relocations properly.
ClosedPublic

Authored by grimar on Sep 16 2019, 6:40 AM.

Details

Summary

We had a precompiled binary committed and not all of the relocations
supported were tested. This patch fixes this.

Depends on https://reviews.llvm.org/D67615

Diff Detail

Event Timeline

grimar created this revision.Sep 16 2019, 6:40 AM

Looks good, though, as a belated thought after D62594, I wonder if we really want to test every enum member listed in BinaryFormat/ELFRelocs/*.def. The source code just uses the X macros pattern to support every enum member, but we test every possibility.

grimar added a comment.EditedSep 17 2019, 1:41 AM

Looks good, though, as a belated thought after D62594, I wonder if we really want to test every enum member listed in BinaryFormat/ELFRelocs/*.def. The source code just uses the X macros pattern to support every enum member, but we test every possibility.

I think it is good to test everything because of the following reasons.

  1. We might want to check the relocation values (i.e. that declarations in .*def are correct)
  2. When we add new relocations we add a test(s) for them. Perhaps it would look not that clear why we test some of the relocations, but not another ones.
  3. It is just a simpler logic. I.e. testing everything is simpler here than explaining or thinking about why we do not do it :)
This revision is now accepted and ready to land.Sep 17 2019, 2:11 AM
MaskRay accepted this revision.Sep 17 2019, 2:16 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2019, 5:04 AM