Next set of additional error checks for invalid Mach-O files.
authorKevin Enderby <enderby@apple.com>
Fri, 12 Aug 2016 20:10:25 +0000 (20:10 +0000)
committerKevin Enderby <enderby@apple.com>
Fri, 12 Aug 2016 20:10:25 +0000 (20:10 +0000)
commitc614d283b7aecbc9bee0b7bdb7902d2796b04a8c
tree9f43e9ce045b19c270e196880462f8a502bbbcbe
parent17a907588ceb6c012fa3d92d5c68feb821f989a4
Next set of additional error checks for invalid Mach-O files.

This contains the two missing checks for LC_SEGMENT load command fields.
And checks for the Mach-O sections fields that would make them invalid.

With the new checks, some of the existing malformed file checks now trips one
of these instead of the issue it was having before so those tests were adjusted.

llvm-svn: 278557
13 files changed:
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/Inputs/macho-invalid-section-addr [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-addr-size [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-offset [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-offset-in-headers [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-offset-size [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-reloff [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-reloff-nrelocs [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-section-size-filesize [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-segment-filesize [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-segment-vmsize [new file with mode: 0644]
llvm/test/Object/macho-invalid.test
llvm/test/tools/llvm-objdump/X86/malformed-machos.test