[PATCH] D144009: [obj2yaml] Save offset for segments and size for PHDR

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 00:35:33 PST 2023


treapster added a comment.

In D144009#4131236 <https://reviews.llvm.org/D144009#4131236>, @jhenderson wrote:

> Could you clarify why you only emit the sizes for the PHDR type? It's perfectly legitimate for other segment types to have a size that covers other areas too that aren't parts of sections (and therefore the size can't be derived purely from the section size), but IIRC, yaml2obj will assume the sizes match unless told otherwise. I suppose it might be necessary to emit Fill "sections" in the YAML to cover the gap in some cases to ensure section layout works correctly.

I don't know of any practical examples of segments aside from PHDR and first load which cover out-of-section space, and with these two cases, the size will be properly adjusted by yaml2obj to cover everything from the provided offset to the last included section, or we'll provide it for PHDR in absence of sections.


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

https://reviews.llvm.org/D144009



More information about the llvm-commits mailing list