summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-09-28 23:16:01 +0000
committerKevin Enderby <enderby@apple.com>2016-09-28 23:16:01 +0000
commit76966bf06629e6b73e8d62cf714d5e7cee579bff (patch)
tree452faa8a37e20e486261d117cdf6e5ef8c418ce5 /llvm/test/Object
parentae1ba73aeb538d26e44c6e66209a6ef49fd8a1b9 (diff)
downloadbcm5719-llvm-76966bf06629e6b73e8d62cf714d5e7cee579bff.tar.gz
bcm5719-llvm-76966bf06629e6b73e8d62cf714d5e7cee579bff.zip
Next set of additional error checks for invalid Mach-O files for the
load command that uses the Mach::rpath_command type but not used in llvm libObject code but used in llvm tool code. This includes just the LC_RPATH load command. llvm-svn: 282649
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-rpath-name_offset-toobigbin0 -> 40 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-rpath-name_toobigbin0 -> 44 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-rpath-smallbin0 -> 44 bytes
-rw-r--r--llvm/test/Object/macho-invalid.test9
4 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-rpath-name_offset-toobig b/llvm/test/Object/Inputs/macho-invalid-rpath-name_offset-toobig
new file mode 100644
index 00000000000..0a4849ab192
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-rpath-name_offset-toobig
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-rpath-name_toobig b/llvm/test/Object/Inputs/macho-invalid-rpath-name_toobig
new file mode 100644
index 00000000000..2a1abe60a31
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-rpath-name_toobig
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-rpath-small b/llvm/test/Object/Inputs/macho-invalid-rpath-small
new file mode 100644
index 00000000000..5a6944fc629
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-rpath-small
Binary files differ
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index c42de88218c..c4048db23b6 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -313,3 +313,12 @@ INVALID-VERS-SMALL: macho-invalid-vers-small': truncated or malformed object (lo
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-vers-more-than-one 2>&1 | FileCheck -check-prefix INVALID-VERS-MORE-THAN-ONE %s
INVALID-VERS-MORE-THAN-ONE: macho-invalid-vers-more-than-one': truncated or malformed object (more than one LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, LC_VERSION_MIN_TVOS or LC_VERSION_MIN_WATCHOS command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-rpath-small 2>&1 | FileCheck -check-prefix INVALID-RPATH-SMALL %s
+INVALID-RPATH-SMALL: macho-invalid-rpath-small': truncated or malformed object (load command 0 LC_RPATH cmdsize too small)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-rpath-name_offset-toobig 2>&1 | FileCheck -check-prefix INVALID-RPATH-NAME_OFFSET-TOOBIG %s
+INVALID-RPATH-NAME_OFFSET-TOOBIG: macho-invalid-rpath-name_offset-toobig': truncated or malformed object (load command 0 LC_RPATH path.offset field extends past the end of the load command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-rpath-name_toobig 2>&1 | FileCheck -check-prefix INVALID-RPATH-NAME_TOOBIG %s
+INVALID-RPATH-NAME_TOOBIG: macho-invalid-rpath-name_toobig': truncated or malformed object (load command 0 LC_RPATH library name extends past the end of the load command)
OpenPOWER on IntegriCloud