This removes one more binary object from the inputs and fixes the
test case description.
Previously it said that:
"symbol-index.elf has incorrect type of .symtab section.
There is no symbol bodies because of that and any symbol index becomes incorrect."
But the real reason of the failture was not the incorrect type of a symbol table,
but invalid index of the symbol used in a relocation, what happened because
previous test tried to read .symtab as a SHT_RELA section.
llvm-svn: 359197
Symbols:
- Name: foo
Binding: STB_GLOBAL
+
+## Relocation refers to a symbol with index larger than
+## symbol table size. Check we report it.
+# RUN: yaml2obj -docnum=3 %s -o %t2.o
+# RUN: not ld.lld %t2.o -o %t2 2>&1 | FileCheck %s --check-prefix=ERR3
+# ERR3: error: {{.*}}.o: invalid symbol index
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ - Name: .rela.text
+ Type: SHT_RELA
+ Link: .symtab
+ Info: .text
+ Relocations:
+ - Offset: 0x0000000000000000
+ Symbol: 255
+ Type: R_X86_64_64
+++ /dev/null
-## symbol-index.elf has incorrect type of .symtab section.
-## There is no symbol bodies because of that and any symbol index becomes incorrect.
-## Section Headers:
-## [Nr] Name Type Address Off Size ES Flg Lk Inf Al
-## [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
-## ...
-## [ 4] .symtab RELA 0000000000000000 000048 000030 18 1 2 8
-# RUN: not ld.lld %p/Inputs/symbol-index.elf -o /dev/null 2>&1 | \
-# RUN: FileCheck --check-prefix=INVALID-SYMBOL-INDEX %s
-# INVALID-SYMBOL-INDEX: invalid symbol index