[LLD][ELF] - Add a test case for DT_SONAME entry reading.
authorGeorge Rimar <grimar@accesssoftek.com>
Thu, 16 Aug 2018 14:07:29 +0000 (14:07 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Thu, 16 Aug 2018 14:07:29 +0000 (14:07 +0000)
This covers a following line with a test:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L899

llvm-svn: 339880

lld/test/ELF/invalid/invalid-soname.test [new file with mode: 0644]

diff --git a/lld/test/ELF/invalid/invalid-soname.test b/lld/test/ELF/invalid/invalid-soname.test
new file mode 100644 (file)
index 0000000..8641465
--- /dev/null
@@ -0,0 +1,18 @@
+# REQUIRES: x86
+# RUN: yaml2obj %s -o %t.so
+# RUN: not ld.lld %t.so -o %t.exe 2>&1 | FileCheck %s
+
+# CHECK: error: {{.*}}.so: invalid DT_SONAME entry
+
+--- !ELF
+FileHeader:
+  Class:           ELFCLASS64
+  Data:            ELFDATA2LSB
+  Type:            ET_DYN
+  Machine:         EM_X86_64
+Sections:
+  - Name:          .test
+    Type:          SHT_DYNAMIC
+    Flags:         [ SHF_ALLOC ]
+    Content:         "0e000000000000000000000000000001"
+    Link:          .strtab