summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-20 13:35:33 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-20 13:35:33 +0000
commit073624bb56456655922a9661c975959eaa4e97bc (patch)
treec90279d1708bc270ef4c7f1ce730cf5983dfc338 /llvm/test/Object
parent0050b48f6ca1c9cab7cdd353eb9988a7136b0599 (diff)
downloadbcm5719-llvm-073624bb56456655922a9661c975959eaa4e97bc.tar.gz
bcm5719-llvm-073624bb56456655922a9661c975959eaa4e97bc.zip
Simplify iterating over program headers and detect corrupt ones.
We now use a simple pointer and have range loops. llvm-svn: 242669
Diffstat (limited to 'llvm/test/Object')
-rwxr-xr-xllvm/test/Object/Inputs/corrupt-invalid-phentsize.elf.x86-64bin0 -> 1720 bytes
-rw-r--r--llvm/test/Object/corrupt.test6
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/corrupt-invalid-phentsize.elf.x86-64 b/llvm/test/Object/Inputs/corrupt-invalid-phentsize.elf.x86-64
new file mode 100755
index 00000000000..148d4c5fd64
--- /dev/null
+++ b/llvm/test/Object/Inputs/corrupt-invalid-phentsize.elf.x86-64
Binary files differ
diff --git a/llvm/test/Object/corrupt.test b/llvm/test/Object/corrupt.test
index 2181c7e8907..7c4b1c775ec 100644
--- a/llvm/test/Object/corrupt.test
+++ b/llvm/test/Object/corrupt.test
@@ -31,3 +31,9 @@ RUN: not llvm-readobj -dynamic-table %p/Inputs/corrupt-invalid-strtab.elf.x86-64
RUN: 2>&1 | FileCheck --check-prefix=STRTAB %s
STRTAB: Invalid dynamic string table reference
+
+RUN: not llvm-readobj -program-headers \
+RUN: %p/Inputs/corrupt-invalid-phentsize.elf.x86-64 2>&1 | \
+RUN: FileCheck --check-prefix=PHENTSIZE %s
+
+PHENTSIZE: Invalid program header size
OpenPOWER on IntegriCloud