diff options
-rw-r--r-- | lld/test/ELF/invalid/Inputs/invalid-e_shnum.elf | bin | 0 -> 64 bytes | |||
-rw-r--r-- | lld/test/ELF/invalid/invalid-e_shnum.s | 4 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lld/test/ELF/invalid/Inputs/invalid-e_shnum.elf b/lld/test/ELF/invalid/Inputs/invalid-e_shnum.elf Binary files differnew file mode 100644 index 00000000000..0b46fbd8cec --- /dev/null +++ b/lld/test/ELF/invalid/Inputs/invalid-e_shnum.elf diff --git a/lld/test/ELF/invalid/invalid-e_shnum.s b/lld/test/ELF/invalid/invalid-e_shnum.s new file mode 100644 index 00000000000..fc197e7f285 --- /dev/null +++ b/lld/test/ELF/invalid/invalid-e_shnum.s @@ -0,0 +1,4 @@ +## Spec says that "If a file has no section header table, e_shnum holds the value zero.", though +## in this test case it holds non-zero and lld may crash. +# RUN: not ld.lld %p/Inputs/invalid-e_shnum.elf -o %t2 2>&1 | FileCheck %s +# CHECK: e_shnum should be zero if a file has no section header table
\ No newline at end of file |