[PATCH] D95591: [yaml2obj/obj2yaml] - Implement program header table as a special Chunk.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 06:00:11 PST 2021


jhenderson added a comment.

In D95591#2541825 <https://reviews.llvm.org/D95591#2541825>, @labath wrote:

> Thanks for summarizing this. I haven't been keeping track of recent yaml2obj changes, but all of this looks extremely nice and useful to me. The main functionality I am missing is the ability to (de)serialize core files (no sections, all info is given through program headers and notes), and it sounds like this comes really close to making that possible.

Not a problem! To achieve what I think you're suggesting, I think we'd need to have obj2yaml be able to generate Fills itself. I might be wrong, but I don't think it currently does (Fills are supported in the other direction). I guess the way to do this would be to identify gaps between the other blocks and convert them to Fills with the relevant contents (with no fills required if the size and contents would be the default without the fill). Sounds viable.

>> As noted above, by using the existing Type field to recognise special chunk kinds, and then with the default behaviour being to interpret the value as some section type, I don't think we need an extra line.
>
> Interesting. It slightly overloads the meaning of the "Type" field, but I guess it does make the common case simpler.

One way of looking at it is not to consider sections directly as a kind of chunk, but rather consider each individual type of section as a different chunk kind (e.g. a relocation section, a dynamic section etc). It just so happens that to generate these different chunk kinds, you use SHT_* instead of "RelocationSection" etc.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95591/new/

https://reviews.llvm.org/D95591



More information about the llvm-commits mailing list