This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj] - Add NBucket and NChain fields for the SHT_HASH section.
ClosedPublic

Authored by grimar on Mar 26 2020, 3:18 AM.

Details

Summary

These fields allows to override nchain and nbucket fields of a SHT_HASH section.
I have a plan for a patch where I'd like to use this approach to produce broken inputs.
Overriding of fields is something we already support for a "Section".
An alternative is to set raw "Content", but it doesn't look nice.

Diff Detail

Event Timeline

grimar created this revision.Mar 26 2020, 3:18 AM

Looks fine to me. I'd like to see an example of it being used in a real test case, so I'm holding off on the LGTM until that point.

llvm/include/llvm/ObjectYAML/ELFYAML.h
285

fields which -> fields. This

llvm/test/tools/yaml2obj/ELF/hash-section.yaml
280

This line should probabbly be wrapped.

grimar updated this revision to Diff 252839.Mar 26 2020, 7:18 AM
grimar marked 2 inline comments as done.
  • Addressed review comments.

Going to work and post a patch that uses this functionality.

Going to work and post a patch that uses this functionality.

I need D76920 and D76924 to be landed for the patch mentioned.

grimar updated this revision to Diff 253890.Mar 31 2020, 7:54 AM
  • Fixed a gcc compilation issue .
This revision is now accepted and ready to land.Apr 1 2020, 12:15 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2020, 2:44 AM