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 000200 000009
15 # CHECK-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000209 000030
16 # CHECK-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000239 000018
17 # CHECK-NEXT: [ 4] .strtab STRTAB 0000000000000000 000251 000001
18 # CHECK-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000252 000035
19 # CHECK-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 000287 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 000200 000001
59 # NODYNSYM-NEXT: [ 2] .dynsym DYNSYM 0000000000000150 000201 000018
60 # NODYNSYM-NEXT: [ 3] .symtab SYMTAB 0000000000000000 000219 000018
61 # NODYNSYM-NEXT: [ 4] .strtab STRTAB 0000000000000000 000231 000001
62 # NODYNSYM-NEXT: [ 5] .shstrtab STRTAB 0000000000000000 000232 000035
63 # NODYNSYM-NEXT: [ 6] .text.foo PROGBITS 0000000000000200 000267 000000