brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · cdd75f3 Raw
83 lines · yaml
1## Check we are able to use integers as both2## symbol name indices (st_name values) and symbol names.3# RUN: yaml2obj --docnum=1 %s -o %t4# RUN: llvm-readobj --symbols %t | FileCheck %s5 6# CHECK: Name: test (1)7# CHECK: Name: test (1)8# CHECK: Name: est (2)9# CHECK: Name: 1 (8)10# CHECK: Name: 2 (6)11 12--- !ELF13FileHeader:14  Class: ELFCLASS6415  Data:  ELFDATA2LSB16  Type:  ET_REL17Symbols:18  - Name:   test19  - StName: 120  - StName: 221  - Name:   122  - Name:   223 24## Check we allow specifying both Name and StName at once.25## In this case StName has priority, but the symbol Name is still added26## to the symbol string table.27 28# RUN: yaml2obj --docnum=2 %s -o %t229# RUN: llvm-readobj --symbols --sections --section-data -r --expand-relocs %t2 | FileCheck %s --check-prefix=BOTH30 31# BOTH:      Name: .strtab32# BOTH:      SectionData (33# BOTH-NEXT:   0000: 00666F6F 00 |.foo.|34# BOTH-NEXT: )35 36# BOTH:       Relocations [37# BOTH-NEXT:   Section (1) .rela.data {38# BOTH-NEXT:     Relocation {39# BOTH-NEXT:       Offset: 0x040# BOTH-NEXT:       Type: R_X86_64_NONE (0)41# BOTH-NEXT:       Symbol: <null> (1)42# BOTH-NEXT:       Addend: 0x043# BOTH-NEXT:     }44# BOTH-NEXT:   }45# BOTH-NEXT: ]46 47# BOTH:      Symbols [48# BOTH-NEXT:   Symbol {49# BOTH-NEXT:     Name:  (0)50# BOTH-NEXT:     Value: 0x051# BOTH-NEXT:     Size: 052# BOTH-NEXT:     Binding: Local (0x0)53# BOTH-NEXT:     Type: None (0x0)54# BOTH-NEXT:     Other: 055# BOTH-NEXT:     Section: Undefined (0x0)56# BOTH-NEXT:   }57# BOTH-NEXT:   Symbol {58# BOTH-NEXT:     Name:  (0)59# BOTH-NEXT:     Value: 0x060# BOTH-NEXT:     Size: 061# BOTH-NEXT:     Binding: Local (0x0)62# BOTH-NEXT:     Type: None (0x0)63# BOTH-NEXT:     Other: 064# BOTH-NEXT:     Section: Undefined (0x0)65# BOTH-NEXT:   }66# BOTH-NEXT: ]67 68--- !ELF69FileHeader:70  Class:   ELFCLASS6471  Data:    ELFDATA2LSB72  Type:    ET_REL73  Machine: EM_X86_6474Sections:75  - Name: .rela.data76    Type: SHT_RELA77    Relocations:78      - Type:   R_X86_64_NONE79        Symbol: foo80Symbols:81  - Name:   foo82    StName: 083