aboutsummaryrefslogtreecommitdiff
path: root/test/ELF/invalid
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2018-08-16 13:02:50 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2018-08-16 13:02:50 +0000
commitee6d63fc4190abec4264d5d96c2e0dbcf1b2dec9 (patch)
tree7c64aed4e83b1eccc47ed876a9056e2518199bc9 /test/ELF/invalid
parent489f6c7546c90f1c062759cc3f49c438eaabb5f3 (diff)
[LLD][ELF] - Add a test case.
This covers the following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L487 git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@339876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ELF/invalid')
-rw-r--r--test/ELF/invalid/linkorder-invalid-sec.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ELF/invalid/linkorder-invalid-sec.test b/test/ELF/invalid/linkorder-invalid-sec.test
new file mode 100644
index 000000000..d4aa37663
--- /dev/null
+++ b/test/ELF/invalid/linkorder-invalid-sec.test
@@ -0,0 +1,16 @@
+# REQUIRES: x86
+# RUN: yaml2obj %s -o %t.o
+# RUN: not ld.lld %t.o -o %t.exe 2>&1 | FileCheck %s
+# CHECK: invalid sh_link index: 12345
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .linkorder
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_LINK_ORDER ]
+ Link: 12345