1 ## Check how obj2yaml produces YAML .stack_sizes descriptions.
3 ## Check that obj2yaml uses the "Entries" tag to describe a .stack_sizes section
4 ## when it can extract <address, size> pairs.
6 # RUN: yaml2obj --docnum=1 %s -o %t1
7 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=VALID
10 # VALID-NEXT: FileHeader:
11 # VALID-NEXT: Class: ELFCLASS64
12 # VALID-NEXT: Data: ELFDATA2LSB
13 # VALID-NEXT: Type: ET_EXEC
14 # VALID-NEXT: Sections:
15 # VALID-NEXT: - Name: .stack_sizes
16 # VALID-NEXT: Type: SHT_PROGBITS
17 # VALID-NEXT: Entries:
18 # VALID-NEXT: - Address: 0x10
19 # VALID-NEXT: Size: 0x20
20 # VALID-NEXT: - Address: 0x30
21 # VALID-NEXT: Size: 0x40
31 Content: "100000000000000020300000000000000040"
33 ## Check that obj2yaml uses the "Content" tag to describe a .stack_sizes section
34 ## when it can't extract the entries, for example, when section data is truncated.
36 # RUN: yaml2obj --docnum=2 %s -o %t2
37 # RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID
40 # INVALID-NEXT: FileHeader:
41 # INVALID-NEXT: Class: ELFCLASS64
42 # INVALID-NEXT: Data: ELFDATA2LSB
43 # INVALID-NEXT: Type: ET_EXEC
44 # INVALID-NEXT: Sections:
45 # INVALID-NEXT: - Name: .stack_sizes
46 # INVALID-NEXT: Type: SHT_PROGBITS
47 # INVALID-NEXT: Content: '1000000000000000203000000000000000'
57 Content: "1000000000000000203000000000000000"
59 ## Check obj2yaml can dump empty .stack_sizes.
61 # RUN: yaml2obj --docnum=3 %s -o %t3
62 # RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY
65 # EMPTY-NEXT: FileHeader:
66 # EMPTY-NEXT: Class: ELFCLASS64
67 # EMPTY-NEXT: Data: ELFDATA2LSB
68 # EMPTY-NEXT: Type: ET_EXEC
69 # EMPTY-NEXT: Sections:
70 # EMPTY-NEXT: - Name: .stack_sizes
71 # EMPTY-NEXT: Type: SHT_PROGBITS
72 # EMPTY-NEXT: Content: ''
84 ## Check obj2yaml can dump multiple .stack_sizes.
86 # RUN: yaml2obj --docnum=4 %s -o %t4
87 # RUN: obj2yaml %t4 | FileCheck %s --check-prefix=MULTI
90 # MULTI-NEXT: FileHeader:
91 # MULTI-NEXT: Class: ELFCLASS64
92 # MULTI-NEXT: Data: ELFDATA2LSB
93 # MULTI-NEXT: Type: ET_EXEC
94 # MULTI-NEXT: Sections:
95 # MULTI-NEXT: - Name: .stack_sizes
96 # MULTI-NEXT: Type: SHT_PROGBITS
97 # MULTI-NEXT: Entries:
98 # MULTI-NEXT: - Address: 0x10
99 # MULTI-NEXT: Size: 0x20
100 # MULTI-NEXT: - Address: 0x30
101 # MULTI-NEXT: Size: 0x40
102 # MULTI-NEXT: - Name: '.stack_sizes (1)'
103 # MULTI-NEXT: Type: SHT_PROGBITS
104 # MULTI-NEXT: Entries:
105 # MULTI-NEXT: - Address: 0x50
106 # MULTI-NEXT: Size: 0x1
107 # MULTI-NEXT: - Address: 0x60
108 # MULTI-NEXT: Size: 0x2
123 - Name: '.stack_sizes (1)'