summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-08-30 21:28:30 +0000
committerKevin Enderby <enderby@apple.com>2016-08-30 21:28:30 +0000
commitdcbc504c47565f3dc4e410de3c58e50e48eb5a9b (patch)
tree45cf0b3d1babae60c7e0ba0bb6da676bd4f62b30 /llvm/test
parent6736e199c78d9e6cb33c2a3b03afa13666a6a53b (diff)
downloadbcm5719-llvm-dcbc504c47565f3dc4e410de3c58e50e48eb5a9b.tar.gz
bcm5719-llvm-dcbc504c47565f3dc4e410de3c58e50e48eb5a9b.zip
Next set of additional error checks for invalid Mach-O files for bad LC_DYSYMTAB’s.
This contains the missing checks for LC_DYSYMTAB load command fields. llvm-svn: 280161
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-bad-sizebin0 -> 112 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff-nextrefsymsbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-extreloffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff-nindirectsymsbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff-nlocrelbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff-nmodtabbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-more-than-onebin0 -> 188 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-smallbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoffbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff-ntocbin0 -> 108 bytes
-rw-r--r--llvm/test/Object/macho-invalid.test45
15 files changed, 45 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-bad-size b/llvm/test/Object/Inputs/macho-invalid-dysymtab-bad-size
new file mode 100644
index 00000000000..49065d6334f
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-bad-size
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff
new file mode 100644
index 00000000000..0e80fba0f23
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff-nextrefsyms b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff-nextrefsyms
new file mode 100644
index 00000000000..f08b1330241
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extrefsymoff-nextrefsyms
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-extreloff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extreloff
new file mode 100644
index 00000000000..d04eccaed8f
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-extreloff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff
new file mode 100644
index 00000000000..46d94780b44
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff-nindirectsyms b/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff-nindirectsyms
new file mode 100644
index 00000000000..9c4b3b3781c
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-indirectsymoff-nindirectsyms
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff
new file mode 100644
index 00000000000..0ddab0c3b87
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff-nlocrel b/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff-nlocrel
new file mode 100644
index 00000000000..94f4b2d3f86
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-locreloff-nlocrel
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff
new file mode 100644
index 00000000000..c8e80ac2105
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff-nmodtab b/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff-nmodtab
new file mode 100644
index 00000000000..dd643ca0698
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-modtaboff-nmodtab
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-more-than-one b/llvm/test/Object/Inputs/macho-invalid-dysymtab-more-than-one
new file mode 100644
index 00000000000..0a0f8593d22
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-more-than-one
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-small b/llvm/test/Object/Inputs/macho-invalid-dysymtab-small
new file mode 100644
index 00000000000..53c61f9cc79
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-small
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff b/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff
new file mode 100644
index 00000000000..9a86fd84c21
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff
Binary files differ
diff --git a/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff-ntoc b/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff-ntoc
new file mode 100644
index 00000000000..ec09e312863
--- /dev/null
+++ b/llvm/test/Object/Inputs/macho-invalid-dysymtab-tocoff-ntoc
Binary files differ
diff --git a/llvm/test/Object/macho-invalid.test b/llvm/test/Object/macho-invalid.test
index c2f6ed20bf6..2162a88a52f 100644
--- a/llvm/test/Object/macho-invalid.test
+++ b/llvm/test/Object/macho-invalid.test
@@ -163,3 +163,48 @@ INVALID-SYMTAB-STROFF: macho-invalid-symtab-stroff': truncated or malformed obje
RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-symtab-stroff-strsize 2>&1 | FileCheck -check-prefix INVALID-SYMTAB-STROFF-STRSIZE %s
INVALID-SYMTAB-STROFF-STRSIZE: macho-invalid-symtab-stroff-strsize': truncated or malformed object (stroff field plus strsize field of LC_SYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-small 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-SMALL %s
+INVALID-DYSYMTAB-SMALL: macho-invalid-dysymtab-small': truncated or malformed object (load command 0 LC_DYSYMTAB cmdsize too small)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-more-than-one 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-MORE-THAN-ONE %s
+INVALID-DYSYMTAB-MORE-THAN-ONE: macho-invalid-dysymtab-more-than-one': truncated or malformed object (more than one LC_DYSYMTAB command)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-bad-size 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-BAD-SIZE %s
+INVALID-DYSYMTAB-BAD-SIZE: macho-invalid-dysymtab-bad-size': truncated or malformed object (LC_DYSYMTAB command 0 has incorrect cmdsize)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-tocoff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF %s
+INVALID-DYSYMTAB-TOCOFF: macho-invalid-dysymtab-tocoff': truncated or malformed object (tocoff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-tocoff-ntoc 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-NTOC %s
+INVALID-DYSYMTAB-TOCOFF-NTOC: macho-invalid-dysymtab-tocoff-ntoc': truncated or malformed object (tocoff field plus ntoc field times sizeof(struct dylib_table_of_contents) of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-modtaboff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-MODTABOFF %s
+INVALID-DYSYMTAB-TOCOFF-MODTABOFF: macho-invalid-dysymtab-modtaboff': truncated or malformed object (modtaboff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-modtaboff-nmodtab 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-MODTABOFF-NMODTAB %s
+INVALID-DYSYMTAB-TOCOFF-MODTABOFF-NMODTAB: macho-invalid-dysymtab-modtaboff-nmodtab': truncated or malformed object (modtaboff field plus nmodtab field times sizeof(struct dylib_module) of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-extrefsymoff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-EXTREFSYMOFF %s
+INVALID-DYSYMTAB-TOCOFF-EXTREFSYMOFF: macho-invalid-dysymtab-extrefsymoff': truncated or malformed object (extrefsymoff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-extrefsymoff-nextrefsyms 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-EXTREFSYMOFF-NEXTREFSYMS %s
+INVALID-DYSYMTAB-TOCOFF-EXTREFSYMOFF-NEXTREFSYMS: macho-invalid-dysymtab-extrefsymoff-nextrefsyms': truncated or malformed object (extrefsymoff field plus nextrefsyms field times sizeof(struct dylib_reference) of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-indirectsymoff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-INDIRECTSYMOFF %s
+INVALID-DYSYMTAB-TOCOFF-INDIRECTSYMOFF: macho-invalid-dysymtab-indirectsymoff': truncated or malformed object (indirectsymoff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-indirectsymoff-nindirectsyms 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-INDIRECTSYMOFF-NINDIRECTSYMS %s
+INVALID-DYSYMTAB-TOCOFF-INDIRECTSYMOFF-NINDIRECTSYMS: macho-invalid-dysymtab-indirectsymoff-nindirectsyms': truncated or malformed object (indirectsymoff field plus nindirectsyms field times sizeof(uint32_t) of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-extreloff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-EXTRELOFF %s
+INVALID-DYSYMTAB-TOCOFF-EXTRELOFF: macho-invalid-dysymtab-extreloff': truncated or malformed object (extreloff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-extreloff-nextrel 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-EXTRELOFF-NEXTREL %s
+INVALID-DYSYMTAB-TOCOFF-EXTRELOFF-NEXTREL: macho-invalid-dysymtab-extreloff-nextrel': truncated or malformed object (extreloff field plus nextrel field times sizeof(struct relocation_info) of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-locreloff 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-LOCRELOFF %s
+INVALID-DYSYMTAB-TOCOFF-LOCRELOFF: macho-invalid-dysymtab-locreloff': truncated or malformed object (locreloff field of LC_DYSYMTAB command 0 extends past the end of the file)
+
+RUN: not llvm-objdump -macho -private-headers %p/Inputs/macho-invalid-dysymtab-locreloff-nlocrel 2>&1 | FileCheck -check-prefix INVALID-DYSYMTAB-TOCOFF-LOCRELOFF-NLOCREL %s
+INVALID-DYSYMTAB-TOCOFF-LOCRELOFF-NLOCREL: macho-invalid-dysymtab-locreloff-nlocrel': truncated or malformed object (locreloff field plus nlocrel field times sizeof(struct relocation_info) of LC_DYSYMTAB command 0 extends past the end of the file)
OpenPOWER on IntegriCloud