From e32c31af312928a787a4c3882aac6dfa10c12c5a Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 16 Aug 2018 14:07:29 +0000 Subject: [PATCH] [LLD][ELF] - Add a test case for DT_SONAME entry reading. 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lld/test/ELF/invalid/invalid-soname.test diff --git a/lld/test/ELF/invalid/invalid-soname.test b/lld/test/ELF/invalid/invalid-soname.test new file mode 100644 index 0000000..8641465 --- /dev/null +++ b/lld/test/ELF/invalid/invalid-soname.test @@ -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 -- 2.7.4