HomePhabricator

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

Authored by seiya on Jun 16 2019, 7:07 PM.

Description

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

Summary:
Currently, MachOWriter::writeSectionData writes dummy data (0xdeadbeef) to fill section data areas in the file even if the section is a virtual one. Since virtual sections don't occupy any space in the file, writing dummy data could results the "OS.tell() - fileStart <= Sec.offset" assertion failure.

This patch fixes the bug by simply not writing any dummy data for virtual sections.

Reviewers: beanz, jhenderson, rupprecht, alexshap

Reviewed By: alexshap

Subscribers: compnerd, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62991

llvm-svn: 363525

Details

Committed
seiyaJun 16 2019, 7:07 PM
Reviewer
alexshap
Differential Revision
D62991: [yaml2obj][MachO] Don't fill dummy data for virtual sections
Parents
rG13de174b4c48: [llvm-objcopy] Add elf32-sparc and elf32-sparcel target
Branches
Unknown
Tags
Unknown