summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object/macho-invalid.test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-09-27 23:24:13 +0000
committerKevin Enderby <enderby@apple.com>2016-09-27 23:24:13 +0000
commit3e490ef94efbf87d52aea11eee8bc25739ca95d1 (patch)
tree641c1064dc7d4f68ed67335ea9114fdbc19b3545 /llvm/test/Object/macho-invalid.test
parent75ad3de85b7025e7241e9ee869c6840bee88a531 (diff)
downloadbcm5719-llvm-3e490ef94efbf87d52aea11eee8bc25739ca95d1.tar.gz
bcm5719-llvm-3e490ef94efbf87d52aea11eee8bc25739ca95d1.zip
Next set of additional error checks for invalid Mach-O files for the
other load commands that use the MachO::dylinker_command type but not used in llvm libObject code but used in llvm tool code. This includes LC_ID_DYLINKER, LC_LOAD_DYLINKER and LC_DYLD_ENVIRONMENT load commands. llvm-svn: 282553
Diffstat (limited to 'llvm/test/Object/macho-invalid.test')
-rw-r--r--llvm/test/Object/macho-invalid.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index b1689b6b12d..09928a143ab 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -298,3 +298,12 @@ INVALID-SPLITINFO-DATAOFF-DATASIZE: macho-invalid-splitinfo-dataoff-datasize': t
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dylib_code_sign_drs-bad-size 2>&1 | FileCheck -check-prefix INVALID-DYLIB_CODE_SIGN_DRS-BAD-SIZE %s
INVALID-DYLIB_CODE_SIGN_DRS-BAD-SIZE: macho-invalid-dylib_code_sign_drs-bad-size': truncated or malformed object (LC_DYLIB_CODE_SIGN_DRS command 0 has incorrect cmdsize)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dyld-small 2>&1 | FileCheck -check-prefix INVALID-DYLD-SMALL %s
+INVALID-DYLD-SMALL: macho-invalid-dyld-small': truncated or malformed object (load command 0 LC_ID_DYLINKER cmdsize too small)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dyld-name_offset-toobig 2>&1 | FileCheck -check-prefix INVALID-DYLD-NAME_OFFSET-TOOBIG %s
+INVALID-DYLD-NAME_OFFSET-TOOBIG: macho-invalid-dyld-name_offset-toobig': truncated or malformed object (load command 0 LC_LOAD_DYLINKER name.offset field extends past the end of the load command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dyld-name_toobig 2>&1 | FileCheck -check-prefix INVALID-DYLD-NAME_TOOBIG %s
+INVALID-DYLD-NAME_TOOBIG: macho-invalid-dyld-name_toobig': truncated or malformed object (load command 0 LC_DYLD_ENVIRONMENT dyld name extends past the end of the load command)
OpenPOWER on IntegriCloud