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

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 31 05:42:49 PST 2021


labath added a comment.

In D95591#2531495 <https://reviews.llvm.org/D95591#2531495>, @MaskRay wrote:

> If the idea is that we will have ability to create two program header tables, this seems fine. Such an ability has no use though because only the one referenced by `e_phoff` matters.
> So I am still on the fence whether there is a good syntax.
>
> + @labath who added some `ProgramHeaders:` yaml2obj tests to `lldb/test/Shell`.

Overall, I like the ability to explicitly control the location of program headers.

As for @MaskRay's question, I don't have any real answers, but I am going to make an observation. :)

The way I see it, the root cause of the problem here is that the top item item is called "Sections". The name kind of stopped being correct back when we allowed non-section filler chunks. Now it will be even less correct. If you follow this up with (I don't know if its in the works, but it would totally make sense to me) a change to control the placement/contents of section headers, it will become amusingly (confusingly?) self-referential.

If, instead, the top level item was called "Chunks", or "Layout", or "Contents", then it would not be weird to see program (or section) headers described inside. OTOH, it would make the (common) case of describing a section longer (by one line) as they would no longer automatically get the "section" kind.

Whether that's worth it... I don't know...


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

https://reviews.llvm.org/D95591



More information about the llvm-commits mailing list