brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 6a1619e Raw
73 lines · plain
1# RUN: yaml2obj --docnum=1 %s -o %t1.o2# RUN: not ld.lld %t1.o -o /dev/null 2>&1 | FileCheck %s3# CHECK: error: {{.*}}.o: relocation section (index 2) has invalid sh_info (0)4 5--- !ELF6FileHeader:7  Class:         ELFCLASS648  Data:          ELFDATA2LSB9  Type:          ET_REL10  Machine:       EM_X86_6411Sections:        12  - Name:        .text13    Type:        SHT_PROGBITS14    Flags:       [ SHF_ALLOC, SHF_EXECINSTR ]15  - Name:        .rela.text16    Type:        SHT_RELA17    Link:        .symtab18    Info:        019    Relocations: 20      - Symbol:  foo21        Type:    R_X86_64_6422Symbols:         23  - Name:        foo24    Binding:     STB_GLOBAL25 26# RUN: yaml2obj --docnum=2 %s -o %t2.o27# RUN: not ld.lld %t2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR228# ERR2: error: {{.*}}.o: relocation section (index 2) has invalid sh_info (99)29 30--- !ELF31FileHeader:32  Class:         ELFCLASS6433  Data:          ELFDATA2LSB34  Type:          ET_REL35  Machine:       EM_X86_6436Sections:        37  - Name:        .text38    Type:        SHT_PROGBITS39    Flags:       [ SHF_ALLOC, SHF_EXECINSTR ]40  - Name:        .rela.text41    Type:        SHT_RELA42    Link:        .symtab43    Info:        9944    Relocations: 45      - Symbol:  foo46        Type:    R_X86_64_6447Symbols:         48  - Name:        foo49    Binding:     STB_GLOBAL50 51## Relocation refers to a symbol with index larger than52## symbol table size. Check we report it.53# RUN: yaml2obj --docnum=3 %s -o %t2.o54# RUN: env LLD_IN_TEST=1 not ld.lld %t2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR355# ERR3: error: {{.*}}.o: invalid symbol index56 57--- !ELF58FileHeader:59  Class:         ELFCLASS6460  Data:          ELFDATA2LSB61  Type:          ET_REL62  Machine:       EM_X86_6463Sections:64  - Name:        .text65    Type:        SHT_PROGBITS66    Flags:       [ SHF_ALLOC, SHF_EXECINSTR ]67  - Name:        .rela.text68    Type:        SHT_RELA69    Info:        .text70    Relocations:71      - Symbol:  25572        Type:    R_X86_64_6473