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

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 03:32:36 PST 2023


treapster added a comment.



> ! In D144009#4131236 <https://reviews.llvm.org/D144009#4131236>, @jhenderson wrote:
>  Hard-coding the size means it will fall down if somebody decides to manually add an additional program header to the YAML produced by obj2yaml, for example.

I think you should not just manually add a segment bacause it will move all the other parts of the file and, again, invalidate all the mappings, possibly causing some sections to come out of address space. But if you remove a segment **and** have PHDR size hardcoded, you didn't break anything, since the new space will just become NULL segment but all the mappings are still valid.


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

https://reviews.llvm.org/D144009



More information about the llvm-commits mailing list