brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 0357089 Raw
62 lines · plain
1# This test intentionally checks for fatal errors, and fatal errors aren't supported for testing when main is run twice.2# XFAIL: main-run-twice3## .symtab's sh_info contains zero value. First entry in a .symtab is a4## zero entry that must exist in a valid object, so sh_info can't be null.5## Check we report a proper error for that case.6# RUN: yaml2obj --docnum=1 %s -o %t.o7# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR18# ERR1: invalid sh_info in symbol table9 10--- !ELF11FileHeader:12  Class:           ELFCLASS6413  Data:            ELFDATA2LSB14  Type:            ET_REL15  Machine:         EM_X86_6416Sections:17  - Name:            .symtab18    Info:            019    Type:            SHT_SYMTAB20Symbols:21  - Name:          foo22    Binding:       STB_GLOBAL23 24## sh_info has value 2 what says that non-local symbol `foo` is local.25## Check we report this case.26# RUN: yaml2obj --docnum=2 %s -o %t.o27# RUN: not ld.lld --noinhibit-exec %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR2 %s28# ERR2: error: {{.*}}.o: non-local symbol (1) found at index < .symtab's sh_info (2)29 30--- !ELF31FileHeader:32  Class:           ELFCLASS6433  Data:            ELFDATA2LSB34  Type:            ET_REL35  Machine:         EM_X86_6436Sections:37  - Name:            .symtab38    Info:            239    Type:            SHT_SYMTAB40Symbols:41  - Name:          foo42    Binding:       STB_GLOBAL43 44## sh_info has value 0xff what is larger than number of symbols in a .symtab.45## Check we report this case.46# RUN: yaml2obj --docnum=3 %s -o %t.o47# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR1 %s48 49--- !ELF50FileHeader:51  Class:           ELFCLASS6452  Data:            ELFDATA2LSB53  Type:            ET_REL54  Machine:         EM_X86_6455Sections:56  - Name:            .symtab57    Info:            0xff58    Type:            SHT_SYMTAB59Symbols:60  - Name:          foo61    Binding:       STB_GLOBAL62