[PATCH] D62991: [yaml2obj][MachO] Don't fill dummy data for virtual sections

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 04:24:08 PDT 2019


seiya added a comment.

In D62991#1533463 <https://reviews.llvm.org/D62991#1533463>, @alexshap wrote:

> khm, could you please explain the rationale for this change ? If yaml2obj completely ignores virtual sections we won't be able to create a MachO binary containing them, moreover, even in some simple cases the round trip conversion yaml -> obj -> yaml will create a completely different binary. Having ability to create binaries with virtual sections overall seems to be useful for testing various tools etc.


The description was insufficient and updated the summary. This patch is intended for fixing the problem so that we can create a MachO binary containing virtual sections

Currently, an assertion (`OS.tell() - fileStart <= Sec.offset ...`) in yaml2macho.cpp could fails if there are virtual sections in the yaml file: it writes `Sec.size`-sized dummy data into section data areas even if the section is virtual and finally `OS.tell() - fileStart` goes beyond the file offset of the next section `Sec.offset`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62991





More information about the llvm-commits mailing list