Index: test/ELF/Inputs/invalid-binding.elf =================================================================== --- test/ELF/Inputs/invalid-binding.elf +++ test/ELF/Inputs/invalid-binding.elf @@ -1 +0,0 @@ -ELF>˜@@ 0.text.bssfoo.strtab.symtab.datap&@ @@@0 \ No newline at end of file Index: test/ELF/Inputs/invalid-cie-version2.elf =================================================================== --- test/ELF/Inputs/invalid-cie-version2.elf +++ test/ELF/Inputs/invalid-cie-version2.elf @@ -1,2 +0,0 @@ -ELF>¨@@ zRx 0D 4H.text_start.bssgarbarfoo.rela.eh_frame.strtab.symtab.data.`D@>@@@AC$HXH -6 x \ No newline at end of file Index: test/ELF/Inputs/invalid-data-encoding.a =================================================================== --- test/ELF/Inputs/invalid-data-encoding.a +++ test/ELF/Inputs/invalid-data-encoding.a @@ -1,4 +0,0 @@ -! -/ 0 0 0 0 12 ` -Pfootest.o/ 0 0 0 644 16 ` -ELF \ No newline at end of file Index: test/ELF/Inputs/invalid-file-class.a =================================================================== --- test/ELF/Inputs/invalid-file-class.a +++ test/ELF/Inputs/invalid-file-class.a @@ -1,4 +0,0 @@ -! -/ 0 0 0 0 12 ` -Pfootest.o/ 0 0 0 644 16 ` -ELF \ No newline at end of file Index: test/ELF/Inputs/invalid-multiple-eh-relocs.elf =================================================================== --- test/ELF/Inputs/invalid-multiple-eh-relocs.elf +++ test/ELF/Inputs/invalid-multiple-eh-relocs.elf @@ -1 +0,0 @@ -ELF>@@zRx  .text.rela.eh_frame.strtab.symtab.rela.dataØ1@ p@0¨+p&Àx0 \ No newline at end of file Index: test/ELF/Inputs/invalid-section-index.elf =================================================================== --- test/ELF/Inputs/invalid-section-index.elf +++ test/ELF/Inputs/invalid-section-index.elf @@ -1 +0,0 @@ -ELF> @@.text_start.bss.strtab.symtab.datap)@#@@@0 \ No newline at end of file Index: test/ELF/Inputs/invalid-shentsize-zero.elf =================================================================== --- test/ELF/Inputs/invalid-shentsize-zero.elf +++ test/ELF/Inputs/invalid-shentsize-zero.elf @@ -1 +0,0 @@ -ELF>À@@B.text_startfoo.mysec.strtab.symtab)@@!HH \ No newline at end of file Index: test/ELF/Inputs/invalid-shstrndx.so =================================================================== --- test/ELF/Inputs/invalid-shstrndx.so +++ test/ELF/Inputs/invalid-shstrndx.so @@ -1,3 +0,0 @@ -ELF>@h0@8@ -ÿ(( PP000 PP0 -.text.bss.dynstr.dynsym.hash.dynamic.strtab.symtab.data; " P 0030 + 0A \ No newline at end of file Index: test/ELF/Inputs/invalid-symtab-sh_info.elf =================================================================== --- test/ELF/Inputs/invalid-symtab-sh_info.elf +++ test/ELF/Inputs/invalid-symtab-sh_info.elf @@ -1 +0,0 @@ -ELF>€@@.text.bss.strtab.symtab.data X"@@@@ \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-binding.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-binding.elf +++ test/ELF/Invalid/Inputs/invalid-binding.elf @@ -0,0 +1 @@ +ELF>˜@@ 0.text.bssfoo.strtab.symtab.datap&@ @@@0 \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-cie-version2.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-cie-version2.elf +++ test/ELF/Invalid/Inputs/invalid-cie-version2.elf @@ -0,0 +1,2 @@ +ELF>¨@@ zRx 0D 4H.text_start.bssgarbarfoo.rela.eh_frame.strtab.symtab.data.`D@>@@@AC$HXH +6 x \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-data-encoding.a =================================================================== --- test/ELF/Invalid/Inputs/invalid-data-encoding.a +++ test/ELF/Invalid/Inputs/invalid-data-encoding.a @@ -0,0 +1,4 @@ +! +/ 0 0 0 0 12 ` +Pfootest.o/ 0 0 0 644 16 ` +ELF \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-file-class.a =================================================================== --- test/ELF/Invalid/Inputs/invalid-file-class.a +++ test/ELF/Invalid/Inputs/invalid-file-class.a @@ -0,0 +1,4 @@ +! +/ 0 0 0 0 12 ` +Pfootest.o/ 0 0 0 644 16 ` +ELF \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-multiple-eh-relocs.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-multiple-eh-relocs.elf +++ test/ELF/Invalid/Inputs/invalid-multiple-eh-relocs.elf @@ -0,0 +1 @@ +ELF>@@zRx  .text.rela.eh_frame.strtab.symtab.rela.dataØ1@ p@0¨+p&Àx0 \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-section-index.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-section-index.elf +++ test/ELF/Invalid/Inputs/invalid-section-index.elf @@ -0,0 +1 @@ +ELF> @@.text_start.bss.strtab.symtab.datap)@#@@@0 \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-shentsize-zero.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-shentsize-zero.elf +++ test/ELF/Invalid/Inputs/invalid-shentsize-zero.elf @@ -0,0 +1 @@ +ELF>À@@B.text_startfoo.mysec.strtab.symtab)@@!HH \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-shstrndx.so =================================================================== --- test/ELF/Invalid/Inputs/invalid-shstrndx.so +++ test/ELF/Invalid/Inputs/invalid-shstrndx.so @@ -0,0 +1,3 @@ +ELF>@h0@8@ +ÿ(( PP000 PP0 +.text.bss.dynstr.dynsym.hash.dynamic.strtab.symtab.data; " P 0030 + 0A \ No newline at end of file Index: test/ELF/Invalid/Inputs/invalid-symtab-sh_info.elf =================================================================== --- test/ELF/Invalid/Inputs/invalid-symtab-sh_info.elf +++ test/ELF/Invalid/Inputs/invalid-symtab-sh_info.elf @@ -0,0 +1 @@ +ELF>€@@.text.bss.strtab.symtab.data X"@@@@ \ No newline at end of file Index: test/ELF/Invalid/eh-frame-hdr-no-out.s =================================================================== --- test/ELF/Invalid/eh-frame-hdr-no-out.s +++ test/ELF/Invalid/eh-frame-hdr-no-out.s @@ -0,0 +1,6 @@ +// REQUIRES: x86 +// RUN: not ld.lld --eh-frame-hdr %p/Inputs/invalid-cie-version2.elf -o %t >& %t.log +// RUN: FileCheck %s < %t.log + +// invalid-cie-version2.elf contains unsupported version of CIE = 2. +// CHECK: FDE version 1 or 3 expected, but got 2 Index: test/ELF/Invalid/invalid-elf.test =================================================================== --- test/ELF/Invalid/invalid-elf.test +++ test/ELF/Invalid/invalid-elf.test @@ -0,0 +1,31 @@ +# RUN: llvm-mc %s -o %t -filetype=obj -triple x86_64-pc-linux + +# RUN: not ld.lld %t %p/Inputs/invalid-data-encoding.a -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-DATA-ENC %s +# INVALID-DATA-ENC: invalid data encoding: test.o + +# RUN: not ld.lld %t %p/Inputs/invalid-file-class.a -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-FILE-CLASS %s +# INVALID-FILE-CLASS: invalid file class: test.o + +# RUN: not ld.lld %p/Inputs/invalid-symtab-sh_info.elf -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-SYMTAB-SHINFO %s +# INVALID-SYMTAB-SHINFO: invalid sh_info in symbol table + +# RUN: not ld.lld %p/Inputs/invalid-binding.elf -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-BINDING %s +# INVALID-BINDING: unexpected binding + +# RUN: not ld.lld %p/Inputs/invalid-section-index.elf -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-SECTION-INDEX-LLD %s +# INVALID-SECTION-INDEX-LLD: invalid section index + +# RUN: not ld.lld %p/Inputs/invalid-shstrndx.so -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-SECTION-INDEX %s +# INVALID-SECTION-INDEX: Invalid section index + +# RUN: not ld.lld %p/Inputs/invalid-multiple-eh-relocs.elf -o %t2 2>&1 | \ +# RUN: FileCheck --check-prefix=INVALID-EH-RELOCS %s +# INVALID-EH-RELOCS: multiple relocation sections to .eh_frame are not supported + +.long foo Index: test/ELF/Invalid/merge-invalid-size.s =================================================================== --- test/ELF/Invalid/merge-invalid-size.s +++ test/ELF/Invalid/merge-invalid-size.s @@ -0,0 +1,10 @@ +// REQUIRES: x86 +// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux +// RUN: not ld.lld %t.o -o %t.so 2>&1 | FileCheck %s +// CHECK: SHF_MERGE section size must be a multiple of sh_entsize + +// Test that we accept a zero sh_entsize. +// RUN: ld.lld %p/Inputs/invalid-shentsize-zero.elf -o %t2 + +.section .foo,"aM",@progbits,4 +.short 42 Index: test/ELF/eh-frame-hdr-no-out.s =================================================================== --- test/ELF/eh-frame-hdr-no-out.s +++ test/ELF/eh-frame-hdr-no-out.s @@ -1,6 +0,0 @@ -// REQUIRES: x86 -// RUN: not ld.lld --eh-frame-hdr %p/Inputs/invalid-cie-version2.elf -o %t >& %t.log -// RUN: FileCheck %s < %t.log - -// invalid-cie-version2.elf contains unsupported version of CIE = 2. -// CHECK: FDE version 1 or 3 expected, but got 2 Index: test/ELF/invalid-elf.test =================================================================== --- test/ELF/invalid-elf.test +++ test/ELF/invalid-elf.test @@ -1,31 +0,0 @@ -# RUN: llvm-mc %s -o %t -filetype=obj -triple x86_64-pc-linux - -# RUN: not ld.lld %t %p/Inputs/invalid-data-encoding.a -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-DATA-ENC %s -# INVALID-DATA-ENC: invalid data encoding: test.o - -# RUN: not ld.lld %t %p/Inputs/invalid-file-class.a -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-FILE-CLASS %s -# INVALID-FILE-CLASS: invalid file class: test.o - -# RUN: not ld.lld %p/Inputs/invalid-symtab-sh_info.elf -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-SYMTAB-SHINFO %s -# INVALID-SYMTAB-SHINFO: invalid sh_info in symbol table - -# RUN: not ld.lld %p/Inputs/invalid-binding.elf -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-BINDING %s -# INVALID-BINDING: unexpected binding - -# RUN: not ld.lld %p/Inputs/invalid-section-index.elf -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-SECTION-INDEX-LLD %s -# INVALID-SECTION-INDEX-LLD: invalid section index - -# RUN: not ld.lld %p/Inputs/invalid-shstrndx.so -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-SECTION-INDEX %s -# INVALID-SECTION-INDEX: Invalid section index - -# RUN: not ld.lld %p/Inputs/invalid-multiple-eh-relocs.elf -o %t2 2>&1 | \ -# RUN: FileCheck --check-prefix=INVALID-EH-RELOCS %s -# INVALID-EH-RELOCS: multiple relocation sections to .eh_frame are not supported - -.long foo Index: test/ELF/merge-invalid-size.s =================================================================== --- test/ELF/merge-invalid-size.s +++ test/ELF/merge-invalid-size.s @@ -1,10 +0,0 @@ -// REQUIRES: x86 -// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux -// RUN: not ld.lld %t.o -o %t.so 2>&1 | FileCheck %s -// CHECK: SHF_MERGE section size must be a multiple of sh_entsize - -// Test that we accept a zero sh_entsize. -// RUN: ld.lld %p/Inputs/invalid-shentsize-zero.elf -o %t2 - -.section .foo,"aM",@progbits,4 -.short 42