summaryrefslogtreecommitdiffstats
path: root/llvm/test/Object
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-10-04 09:25:39 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-10-04 09:25:39 +0000
commit67443021a4fb9af0391146287203063f0e64a9ec (patch)
treecc396cbbe6e97387ad2c11170044d8e16ee5ce81 /llvm/test/Object
parent7c4fe0e9a323c849f3ab14354cbf1bb00fce1ee7 (diff)
downloadbcm5719-llvm-67443021a4fb9af0391146287203063f0e64a9ec.tar.gz
bcm5719-llvm-67443021a4fb9af0391146287203063f0e64a9ec.zip
[Object/ELF] - Do not crash on invalid sh_offset value of REL[A] section.
Previously code would access invalid memory and may crash, patch fixes the issue. Differential revision: https://reviews.llvm.org/D25187 llvm-svn: 283204
Diffstat (limited to 'llvm/test/Object')
-rw-r--r--llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386bin0 -> 358 bytes
-rw-r--r--llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64bin0 -> 543 bytes
-rw-r--r--llvm/test/Object/invalid.test6
3 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386 b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386
new file mode 100644
index 00000000000..84fcd0d1d00
--- /dev/null
+++ b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-i386
Binary files differ
diff --git a/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64
new file mode 100644
index 00000000000..aae6c1e9c1c
--- /dev/null
+++ b/llvm/test/Object/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64
Binary files differ
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index e19583d4be1..2d5e0e27440 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -58,3 +58,9 @@ INVALID-XINDEX-SIZE: Invalid data was encountered while parsing the file.
RUN: not llvm-readobj -t %p/Inputs/invalid-ext-symtab-index.elf-x86-64 2>&1 | \
RUN: FileCheck --check-prefix=INVALID-EXT-SYMTAB-INDEX %s
INVALID-EXT-SYMTAB-INDEX: Invalid symbol table index
+
+RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-i386 2>&1 | \
+RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
+RUN: not llvm-readobj -r %p/Inputs/invalid-relocation-sec-sh_offset.elf-x86-64 2>&1 | \
+RUN: FileCheck --check-prefix=INVALID-RELOC-SH-OFFSET %s
+INVALID-RELOC-SH-OFFSET: Invalid relocation entry offset
OpenPOWER on IntegriCloud