stack-sizes.yaml
3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
## Check how obj2yaml produces YAML .stack_sizes descriptions.
## Check that obj2yaml uses the "Entries" tag to describe a .stack_sizes section
## when it can extract <address, size> pairs.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: obj2yaml %t1 | FileCheck %s --check-prefix=VALID
# VALID: --- !ELF
# VALID-NEXT: FileHeader:
# VALID-NEXT: Class: ELFCLASS64
# VALID-NEXT: Data: ELFDATA2LSB
# VALID-NEXT: Type: ET_EXEC
# VALID-NEXT: Sections:
# VALID-NEXT: - Name: .stack_sizes
# VALID-NEXT: Type: SHT_PROGBITS
# VALID-NEXT: Entries:
# VALID-NEXT: - Address: 0x0000000000000010
# VALID-NEXT: Size: 0x0000000000000020
# VALID-NEXT: - Address: 0x0000000000000030
# VALID-NEXT: Size: 0x0000000000000040
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .stack_sizes
Type: SHT_PROGBITS
Content: "100000000000000020300000000000000040"
## Check that obj2yaml uses the "Content" tag to describe a .stack_sizes section
## when it can't extract the entries, for example, when section data is truncated.
# RUN: yaml2obj --docnum=2 %s -o %t2
# RUN: obj2yaml %t2 | FileCheck %s --check-prefix=INVALID
# INVALID: --- !ELF
# INVALID-NEXT: FileHeader:
# INVALID-NEXT: Class: ELFCLASS64
# INVALID-NEXT: Data: ELFDATA2LSB
# INVALID-NEXT: Type: ET_EXEC
# INVALID-NEXT: Sections:
# INVALID-NEXT: - Name: .stack_sizes
# INVALID-NEXT: Type: SHT_PROGBITS
# INVALID-NEXT: Content: '1000000000000000203000000000000000'
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .stack_sizes
Type: SHT_PROGBITS
Content: "1000000000000000203000000000000000"
## Check obj2yaml can dump empty .stack_sizes.
# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: obj2yaml %t3 | FileCheck %s --check-prefix=EMPTY
# EMPTY: --- !ELF
# EMPTY-NEXT: FileHeader:
# EMPTY-NEXT: Class: ELFCLASS64
# EMPTY-NEXT: Data: ELFDATA2LSB
# EMPTY-NEXT: Type: ET_EXEC
# EMPTY-NEXT: Sections:
# EMPTY-NEXT: - Name: .stack_sizes
# EMPTY-NEXT: Type: SHT_PROGBITS
# EMPTY-NEXT: Content: ''
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .stack_sizes
Type: SHT_PROGBITS
Content: ""
## Check obj2yaml can dump multiple .stack_sizes.
# RUN: yaml2obj --docnum=4 %s -o %t4
# RUN: obj2yaml %t4 | FileCheck %s --check-prefix=MULTI
# MULTI: --- !ELF
# MULTI-NEXT: FileHeader:
# MULTI-NEXT: Class: ELFCLASS64
# MULTI-NEXT: Data: ELFDATA2LSB
# MULTI-NEXT: Type: ET_EXEC
# MULTI-NEXT: Sections:
# MULTI-NEXT: - Name: .stack_sizes
# MULTI-NEXT: Type: SHT_PROGBITS
# MULTI-NEXT: Entries:
# MULTI-NEXT: - Address: 0x0000000000000010
# MULTI-NEXT: Size: 0x0000000000000020
# MULTI-NEXT: - Address: 0x0000000000000030
# MULTI-NEXT: Size: 0x0000000000000040
# MULTI-NEXT: - Name: '.stack_sizes (1)'
# MULTI-NEXT: Type: SHT_PROGBITS
# MULTI-NEXT: Entries:
# MULTI-NEXT: - Address: 0x0000000000000050
# MULTI-NEXT: Size: 0x0000000000000001
# MULTI-NEXT: - Address: 0x0000000000000060
# MULTI-NEXT: Size: 0x0000000000000002
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .stack_sizes
Type: SHT_PROGBITS
Entries:
- Address: 0x0000000000000010
Size: 0x0000000000000020
- Address: 0x0000000000000030
Size: 0x0000000000000040
- Name: '.stack_sizes (1)'
Type: SHT_PROGBITS
Entries:
- Address: 0x0000000000000050
Size: 0x0000000000000001
- Address: 0x0000000000000060
Size: 0x0000000000000002