[PATCH] D78005: [yaml2obj] - Reimplement how tool calculates file and memory sizes of segments.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 11:41:35 PDT 2020


MaskRay added a comment.

> In this case the memory size of the segment should be 0x100 + 0x88 + file offset of the segment (0x78) = 0x200. But without this patch yaml2obj sets the memory size to 0x178, because it calculates the memory size as 0x78 + max(0x100, 0x88).

A better example may be a PT_LOAD which is not the first. (0x78 being counted may look strange to some people). In linkers, the first PT_LOAD may or may not include the ELF header and program headers. Another PT_LOAD can avoid this complexity.


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

https://reviews.llvm.org/D78005





More information about the llvm-commits mailing list