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 000001
15 # CHECK-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000041 000018
16 # CHECK-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000059 000018
17 # CHECK-NEXT: [ 4] .strtab STRTAB 0000000000000000 000071 000001
18 # CHECK-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000072 000035
19 # CHECK-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 0000a7 000000
43 ## Check that yaml2obj creates empty .dynstr and .dynsym sections for
44 ## the case when no dynamic symbols were specified and Content wasn't set,
45 ## but the sections were explicitly listed. Check their VAs are correct.
47 # RUN: yaml2obj --docnum=2 %s -o %t2
48 # RUN: llvm-readelf -S %t2 | FileCheck %s --check-prefix=NODYNSYM
50 # NODYNSYM: Section Headers:
51 # NODYNSYM-NEXT: [Nr] Name Type Address Off Size
52 # NODYNSYM-NEXT: [ 0] NULL 0000000000000000 000000 000000
53 # NODYNSYM-NEXT: [ 1] .dynstr STRTAB 0000000000000100 000040 000001
54 # NODYNSYM-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000041 000018
55 # NODYNSYM-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000059 000018
56 # NODYNSYM-NEXT: [ 4] .strtab STRTAB 0000000000000000 000071 000001
57 # NODYNSYM-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000072 000035
58 # NODYNSYM-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 0000a7 000000
82 ## Check we don't add a symbol table when no "Symbols" key is specified.
84 # RUN: yaml2obj --docnum=3 %s -o %t3
85 # RUN: llvm-readelf -S %t3 | FileCheck /dev/null --implicit-check-not=.symtab
93 ## Check we add a symbol table when "Symbols" key is specified.
95 # RUN: yaml2obj --docnum=4 %s -o %t4
96 # RUN: llvm-readelf -S %t4 | FileCheck %s --check-prefix=SYMTAB