HomePhabricator

[yaml2obj] Make e_phoff and e_phentsize 0 if there are no program headers

Authored by abrachet on Sep 5 2019, 7:27 PM.

Description

[yaml2obj] Make e_phoff and e_phentsize 0 if there are no program headers

Summary: It says here that if there are no program headers than e_phoff should be 0, but currently it is always set after the header. GNU's readelf (but not llvm-readelf) complains about this: readelf: Warning: possibly corrupt ELF header - it has a non-zero program header offset, but no program headers.

Reviewers: jhenderson, grimar, MaskRay, rupprecht

Reviewed By: jhenderson, grimar, MaskRay

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 371162

Details

Committed
abrachetSep 5 2019, 7:27 PM
Reviewer
jhenderson
Differential Revision
D67054: [yaml2obj] Make e_phoff and e_phentsize 0 if there are no program headers
Parents
rGb1cf17527182: gn build: Merge r371159
Branches
Unknown
Tags
Unknown