1 # Show that llvm-readobj prints symbol shndxes correctly, for valid indexes,
2 # invalid indexes (i.e. section indexes that don't correspond to a real
3 # section), reserved values and processor/os-specific index values, for both GNU
6 # Use --dyn-symbols because yaml2obj does not currently support large section indexes
7 # and also does not allow hand-crafting of static symbol tables.
8 # RUN: yaml2obj --docnum=1 %s > %t1
9 # RUN: llvm-readobj --symbols --dyn-symbols %t1 | FileCheck %s --check-prefix=LLVM
10 # RUN: llvm-readelf --symbols --dyn-symbols %t1 | FileCheck %s --check-prefix=GNU1
12 # llvm-readobj doesn't accept shndx values that are not valid section indexes
13 # for LLVM style, so only test GNU output in this case.
14 # RUN: yaml2obj --docnum=2 %s > %t2
15 # RUN: llvm-readelf --symbols %t2 | FileCheck %s --check-prefix=GNU2
18 # LLVM: Section: Undefined (0x0)
20 # LLVM: Section: .text (0x1)
22 # LLVM: Section: Common (0xFFF2)
23 # LLVM: Name: absolute
24 # LLVM: Section: Absolute (0xFFF1)
26 # LLVM: Section: Processor Specific (0xFF01)
28 # LLVM: Section: Operating System Specific (0xFF21)
29 # LLVM: Name: reserved
30 # LLVM: Section: Reserved (0xFFFE)
32 # GNU1: Symbol table '.dynsym' contains 2 entries:
33 # GNU1-NEXT: Num: {{.*}} Ndx Name
34 # GNU1-NEXT: 0: {{.*}} UND
35 # GNU1-NEXT: 1: {{.*}} 1 xindex
36 # GNU1: Symbol table '.symtab' contains 8 entries:
37 # GNU1-NEXT: Num: {{.*}} Ndx Name
38 # GNU1-NEXT: 0: {{.*}} UND
39 # GNU1-NEXT: 1: {{.*}} UND undef
40 # GNU1-NEXT: 2: {{.*}} 1 normal
41 # GNU1-NEXT: 3: {{.*}} COM common
42 # GNU1-NEXT: 4: {{.*}} ABS absolute
43 # GNU1-NEXT: 5: {{.*}} PRC[0xff01] proc
44 # GNU1-NEXT: 6: {{.*}} OS[0xff21] os
45 # GNU1-NEXT: 7: {{.*}} RSV[0xfffe] reserved
47 # GNU2: Symbol table '.symtab' contains 2 entries:
48 # GNU2-NEXT: Num: {{.*}} Ndx Name
49 # GNU2-NEXT: 0: {{.*}} UND
50 # GNU2-NEXT: 1: {{.*}} 66 bad
64 Content: "0078696e64657800"
70 # Symbol with st_name = 1, st_shndx = SHN_XINDEX
71 Content: "000000000000000000000000000000000100000000000000000000000000ffff"
73 Type: SHT_SYMTAB_SHNDX