Another additional error check for invalid Mach-O files for the
authorKevin Enderby <enderby@apple.com>
Thu, 20 Oct 2016 20:10:30 +0000 (20:10 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 20 Oct 2016 20:10:30 +0000 (20:10 +0000)
commitc8bb42283ee6a118219593a2c98abc0974eb5dc4
treec36e97a0770dee048074cc653cd776b11b4ac06f
parent613c00db88e0a206e1223e5be7dfeb9b4a868c7d
Another additional error check for invalid Mach-O files for the
load commands that use the MachO::twolevel_hints_command type
which includes only the LC_TWOLEVEL_HINTS load command.

This is not used in llvm libObject code or in llvm tool code.  But
does appear in one of the binary test files.  While this load command is
obsolete it is easier to add code for it in libObject than edit or change
the binary test case.

llvm-svn: 284769
llvm/lib/Object/MachOObjectFile.cpp
llvm/test/Object/Inputs/macho-invalid-twolevelhints-bad-size [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-twolevelhints-more-than-one [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-twolevelhints-offset [new file with mode: 0644]
llvm/test/Object/Inputs/macho-invalid-twolevelhints-offset-nhints [new file with mode: 0644]
llvm/test/Object/macho-invalid.test