This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] - Support PPC64 relocation types.
ClosedPublic

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

Details

Summary

We do not support them and fail with llvm_unreachable currently.
This is not the only target we do not support and also seems we are missing
the tests for those we have already. But I need this one for another patch,
so posting it separatelly.

Relocation names are taken from llvm\include\llvm\BinaryFormat\ELFRelocs\PowerPC64.def

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Sep 16 2019, 6:21 AM
grimar updated this revision to Diff 220329.Sep 16 2019, 6:46 AM
  • Simplify the YAML a bit.

Looks good, aside from a concern with the error case.

lib/ObjectYAML/ELFYAML.cpp
657 ↗(On Diff #220321)

This shouldn't be llvm_unreachable, since it is very reachable...

It should be, at most, an error instead (though arguably it should just do the enumFallback in that case).

grimar marked an inline comment as done.Sep 17 2019, 2:22 AM
grimar added inline comments.
lib/ObjectYAML/ELFYAML.cpp
657 ↗(On Diff #220321)

Well, probably yes. But this is original logic and also there is at least one more place with the same thing.
Let me address this in a different patch.

Add a support for PPC64 relocations.

Add support for or just Support PPC64 relocation types.

grimar retitled this revision from [obj2yaml] - Add a support for PPC64 relocations. to [obj2yaml] - Add support for PPC64 relocations..Sep 17 2019, 2:59 AM
MaskRay accepted this revision.Sep 17 2019, 3:11 AM

Add a support for PPC64 relocations.

Add support for or just Support PPC64 relocation types.

I used relocation types because I wanted to emphasize we supported more relocation types:)

This revision is now accepted and ready to land.Sep 17 2019, 3:11 AM

Add a support for PPC64 relocations.

Add support for or just Support PPC64 relocation types.

I used relocation types because I wanted to emphasize we supported more relocation types:)

I thought it is a 2 different suggestions :) I'll retitle.

grimar retitled this revision from [obj2yaml] - Add support for PPC64 relocations. to [obj2yaml] - Support PPC64 relocation types..Sep 17 2019, 3:14 AM
jhenderson accepted this revision.Sep 17 2019, 3:41 AM

LGTM.

lib/ObjectYAML/ELFYAML.cpp
657 ↗(On Diff #220321)

Fair enough.

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