brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · f86a934 Raw
107 lines · yaml
1# RUN: yaml2obj --docnum=1 %s -o %t12# RUN: llvm-symbolizer --obj=%t1 0 1 2 | FileCheck %s3 4## The local symbol has no preceding STT_FILE. Its filename is unavailable.5# CHECK:       local6# CHECK-NEXT:  ??:0:07# CHECK-EMPTY:8 9## All local symbols precede all non-local symbols. When there are multiple10## STT_FILE symbols, we cannot tell which file defines the non-local symbol in11## question. We could tell if there is only one STT_FILE but in reality there12## are always more than one file, so implementing the special case is not useful.13# CHECK-NEXT:  global14# CHECK-NEXT:  ??:0:015# CHECK-EMPTY:16# CHECK-NEXT:  weak17# CHECK-NEXT:  ??:0:018# CHECK-EMPTY:19 20--- !ELF21FileHeader:22  Class:   ELFCLASS6423  Data:    ELFDATA2LSB24  Type:    ET_DYN25  Machine: EM_X86_6426Sections:27  - Name:  .text28    Type:  SHT_PROGBITS29    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]30    Size:  331Symbols:32  - Name:    local33    Section: .text34    Value:   035  - Name:    1.c36    Type:    STT_FILE37    Index:   SHN_ABS38  - Name:    global39    Binding: STB_GLOBAL40    Section: .text41    Value:   142  - Name:    weak43    Binding: STB_WEAK44    Section: .text45    Value:   246 47## If st_name of the STT_FILE symbols is invalid, the symbol name is lost as well.48## TODO Keep the symbol name.49# RUN: yaml2obj --docnum=2 %s -o %t250# RUN: not llvm-symbolizer --obj=%t2 0 0 2>&1 | FileCheck %s --check-prefix=CHECK251 52# CHECK2:      llvm-symbolizer{{.*}}: error: '{{.*}}symtab-file2.yaml.tmp2': st_name (0xffff) is past the end of the string table of size53 54--- !ELF55FileHeader:56  Class:   ELFCLASS6457  Data:    ELFDATA2LSB58  Type:    ET_DYN59  Machine: EM_X86_6460Sections:61  - Name:  .text62    Type:  SHT_PROGBITS63    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]64    Size:  165Symbols:66  - StName:  0xffff67    Type:    STT_FILE68    Index:   SHN_ABS69  - Name:    local70    Section: .text71 72# RUN: yaml2obj --docnum=3 %s -o %t373# RUN: llvm-symbolizer --obj=%t3 'DATA 0x1001' 2>&1 | FileCheck %s --check-prefix=CHECK374 75# CHECK3:      code76# CHECK3-NEXT: 4096 277# CHECK3-NEXT: ??:?78# CHECK3-EMPTY:79 80--- !ELF81FileHeader:82  Class:   ELFCLASS6483  Data:    ELFDATA2LSB84  Type:    ET_DYN85  Machine: EM_X86_6486Sections:87  - Name:    .text88    Type:    SHT_PROGBITS89    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]90    Address: 0x100091    Size:    192  - Name:    .debug93    Type:    SHT_PROGBITS94    Address: 0x000095    Size:    0xFFFF96Symbols:97  - Name:    debug98    Section: .debug99    Binding: STB_WEAK100    Value:   0x1001101    Size:    0102  - Name:    code103    Section: .text104    Binding: STB_WEAK105    Value:   0x1000106    Size:    2107