Next set of additional error checks for invalid Mach-O files for bad load commands
authorKevin Enderby <enderby@apple.com>
Wed, 31 Aug 2016 17:57:46 +0000 (17:57 +0000)
committerKevin Enderby <enderby@apple.com>
Wed, 31 Aug 2016 17:57:46 +0000 (17:57 +0000)
commit9d0c945ad6de0aa94d40e48f9cd6a5622fa814f9
tree846d79930947bd6b0083a59a8eae2b2027d7d9db
parent2700bd831ac56a3fc8212968d37f210021264e51
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::linkedit_data_command type for the load commands that are
currently used in the MachOObjectFile constructor.

This contains the missing checks for LC_DATA_IN_CODE and
LC_LINKER_OPTIMIZATION_HINT load commands and the fields for the
Mach::linkedit_data_command type.  Checking for other load commands that
use this type will be added later.

Also fixed a couple of places that was using sizeof(MachOObjectFile::LoadCommandInfo)
that should have been using sizeof(MachO::load_command).

llvm-svn: 280267
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/Inputs/macho-invalid-dataincode-bad-size [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-dataincode-dataoff-datasize [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-dataincode-more-than-one [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-linkopthint-dataoff [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-linkopthint-small [new file with mode: 0644]
llvm/test/Object/macho-invalid.test