This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj] - Add a support for changing EntSize.
ClosedPublic

Authored by grimar on Aug 3 2018, 3:08 AM.

Details

Summary

I was trying to add a test case for LLD and found that it
is impossible to set sh_entsize via yaml.
The patch implements the missing part.

I am sorry, I do not know who is an appropriate reviewer for that,
so added people who seem were involved in recent changes to yaml2obj.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Aug 3 2018, 3:08 AM
grimar edited the summary of this revision. (Show Details)Aug 3 2018, 3:13 AM
jhenderson added inline comments.Aug 3 2018, 4:34 AM
tools/yaml2obj/yaml2elf.cpp
464 ↗(On Diff #158960)

What if a user explicitly requests EntSize 0? I would expect that to override the defaults as much as 1 does.

grimar added inline comments.Aug 3 2018, 4:36 AM
tools/yaml2obj/yaml2elf.cpp
464 ↗(On Diff #158960)

Interesting case, but should we support it right how?

jhenderson added inline comments.Aug 3 2018, 4:39 AM
tools/yaml2obj/yaml2elf.cpp
464 ↗(On Diff #158960)

I don't think it's any different a case to EntSize 1, 2 etc in a SHT_RELR/DYNAMIC etc section.

We could avoid it by using the explicit value only when the section type doesn't imply it, but I'd rather keep the explicit version.

grimar updated this revision to Diff 159162.Aug 4 2018, 12:06 AM
  • Addressed review comments.

LGTM with one nit.

test/tools/yaml2obj/elf-ent-size.yaml
25 ↗(On Diff #159162)

I'm not sure you want this line here at all. Just start the CHECK sequence with the next line.

grimar added a comment.Aug 6 2018, 9:16 AM

Thanks, James!

This revision was not accepted when it landed; it landed in state Needs Review.Aug 7 2018, 1:12 AM
This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.