1 ## Check the section header properties of ".dynsym",
2 ## ".dynstr", ".symtab", ".strtab", ".shstrtab".
3 ## These sections sections are usually added implicitly,
4 ## but here we add them explicitly in YAML and verify.
5 ## We check their order matches YAML and that file offset is
6 ## ascending. This is a natural default behavior.
8 # RUN: yaml2obj --docnum=1 %s -o %t1
9 # RUN: llvm-readelf -S %t1 | FileCheck %s
11 # CHECK: Section Headers:
12 # CHECK-NEXT: [Nr] Name Type Address Off Size
13 # CHECK-NEXT: [ 0] NULL 0000000000000000 000000 000000
14 # CHECK-NEXT: [ 1] .dynstr STRTAB 0000000000000100 000040 000009
15 # CHECK-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000049 000030
16 # CHECK-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000079 000018
17 # CHECK-NEXT: [ 4] .strtab STRTAB 0000000000000000 000091 000001
18 # CHECK-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000092 000035
19 # CHECK-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 0000c7 000000
43 ## Symbol is required for the .dynsym to be generated.
48 ## Check that yaml2obj creates empty .dynstr and .dynsym sections for
49 ## the case when no dynamic symbols were specified and Content wasn't set,
50 ## but the sections were explicitly listed. Check their VAs are correct.
52 # RUN: yaml2obj --docnum=2 %s -o %t2
53 # RUN: llvm-readelf -S %t2 | FileCheck %s --check-prefix=NODYNSYM
55 # NODYNSYM: Section Headers:
56 # NODYNSYM-NEXT: [Nr] Name Type Address Off Size
57 # NODYNSYM-NEXT: [ 0] NULL 0000000000000000 000000 000000
58 # NODYNSYM-NEXT: [ 1] .dynstr STRTAB 0000000000000100 000040 000001
59 # NODYNSYM-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000041 000018
60 # NODYNSYM-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000059 000018
61 # NODYNSYM-NEXT: [ 4] .strtab STRTAB 0000000000000000 000071 000001
62 # NODYNSYM-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000072 000035
63 # NODYNSYM-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 0000a7 000000
88 ## Check we don't add a symbol table when no "Symbols" key is specified.
90 # RUN: yaml2obj --docnum=3 %s -o %t3
91 # RUN: llvm-readelf -S %t3 | FileCheck /dev/null --implicit-check-not=.symtab
100 ## Check we add a symbol table when "Symbols" key is specified.
102 # RUN: yaml2obj --docnum=4 %s -o %t4
103 # RUN: llvm-readelf -S %t4 | FileCheck %s --check-prefix=SYMTAB