unwind.test
7.64 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# RUN: yaml2obj %s > %t.exe
# RUN: llvm-readobj --unwind %t.exe | FileCheck %s
# CHECK: EHFrameHeader {
# CHECK-NEXT: Address: 0x4013c0
# CHECK-NEXT: Offset: 0xbc
# CHECK-NEXT: Size: 0x3c
# CHECK-NEXT: Corresponding Section: .eh_frame_hdr
# CHECK-NEXT: Header {
# CHECK-NEXT: version: 1
# CHECK-NEXT: eh_frame_ptr_enc: 0x1b
# CHECK-NEXT: fde_count_enc: 0x3
# CHECK-NEXT: table_enc: 0x3b
# CHECK-NEXT: eh_frame_ptr: 0x401400
# CHECK-NEXT: fde_count: 6
# CHECK-NEXT: entry 0 {
# CHECK-NEXT: initial_location: 0x4004a0
# CHECK-NEXT: address: 0x401448
# CHECK-NEXT: }
# CHECK-NEXT: entry 1 {
# CHECK-NEXT: initial_location: 0x4004d0
# CHECK-NEXT: address: 0x401418
# CHECK-NEXT: }
# CHECK-NEXT: entry 2 {
# CHECK-NEXT: initial_location: 0x4005b6
# CHECK-NEXT: address: 0x401470
# CHECK-NEXT: }
# CHECK-NEXT: entry 3 {
# CHECK-NEXT: initial_location: 0x4005d0
# CHECK-NEXT: address: 0x401490
# CHECK-NEXT: }
# CHECK-NEXT: entry 4 {
# CHECK-NEXT: initial_location: 0x401250
# CHECK-NEXT: address: 0x4014c0
# CHECK-NEXT: }
# CHECK-NEXT: entry 5 {
# CHECK-NEXT: initial_location: 0x4012c0
# CHECK-NEXT: address: 0x4014f0
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT:}
# CHECK: .eh_frame section at offset 0xf8 address 0x401400:
# CHECK-NEXT: [0x401400] CIE length=20
# CHECK-NEXT: version: 1
# CHECK-NEXT: augmentation: zR
# CHECK-NEXT: code_alignment_factor: 1
# CHECK-NEXT: data_alignment_factor: -8
# CHECK-NEXT: return_address_register: 16
# CHECK: Program:
# CHECK-NEXT: DW_CFA_def_cfa: reg7 +8
# CHECK-NEXT: DW_CFA_offset: reg16 -8
# CHECK-NEXT: DW_CFA_undefined: reg16
# CHECK: [0x401418] FDE length=20 cie=[0x401400]
# CHECK-NEXT: initial_location: 0x4004d0
# CHECK-NEXT: address_range: 0x2a (end : 0x4004fa)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x401430] CIE length=20
# CHECK-NEXT: version: 1
# CHECK-NEXT: augmentation: zR
# CHECK-NEXT: code_alignment_factor: 1
# CHECK-NEXT: data_alignment_factor: -8
# CHECK-NEXT: return_address_register: 16
# CHECK: Program:
# CHECK-NEXT: DW_CFA_def_cfa: reg7 +8
# CHECK-NEXT: DW_CFA_offset: reg16 -8
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x401448] FDE length=36 cie=[0x401430]
# CHECK-NEXT: initial_location: 0x4004a0
# CHECK-NEXT: address_range: 0x20 (end : 0x4004c0)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_def_cfa_offset: +16
# CHECK-NEXT: DW_CFA_advance_loc: 6
# CHECK-NEXT: DW_CFA_def_cfa_offset: +24
# CHECK-NEXT: DW_CFA_advance_loc: 10
# CHECK-NEXT: DW_CFA_def_cfa_expression: DW_OP_breg7 +8, DW_OP_breg16 +0, DW_OP_lit15, DW_OP_and, DW_OP_lit11, DW_OP_ge, DW_OP_lit3, DW_OP_shl, DW_OP_plus
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x401470] FDE length=28 cie=[0x401430]
# CHECK-NEXT: initial_location: 0x4005b6
# CHECK-NEXT: address_range: 0x10 (end : 0x4005c6)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_advance_loc: 1
# CHECK-NEXT: DW_CFA_def_cfa_offset: +16
# CHECK-NEXT: DW_CFA_offset: reg6 -16
# CHECK-NEXT: DW_CFA_advance_loc: 3
# CHECK-NEXT: DW_CFA_def_cfa_register: reg6
# CHECK-NEXT: DW_CFA_advance_loc: 11
# CHECK-NEXT: DW_CFA_def_cfa: reg7 +8
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x401490] FDE length=44 cie=[0x401430]
# CHECK-NEXT: initial_location: 0x4005d0
# CHECK-NEXT: address_range: 0xc7f (end : 0x40124f)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_advance_loc: 5
# CHECK-NEXT: DW_CFA_def_cfa: reg10 +0
# CHECK-NEXT: DW_CFA_advance_loc: 9
# CHECK-NEXT: DW_CFA_expression: reg6 DW_OP_breg6 +0
# CHECK-NEXT: DW_CFA_advance_loc: 5
# CHECK-NEXT: DW_CFA_def_cfa_expression: DW_OP_breg6 -8, DW_OP_deref
# CHECK-NEXT: DW_CFA_advance_loc2: 3174
# CHECK-NEXT: DW_CFA_def_cfa: reg10 +0
# CHECK-NEXT: DW_CFA_advance_loc: 5
# CHECK-NEXT: DW_CFA_def_cfa: reg7 +8
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x4014c0] FDE length=44 cie=[0x401430]
# CHECK-NEXT: initial_location: 0x401250
# CHECK-NEXT: address_range: 0x66 (end : 0x4012b6)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_advance_loc: 1
# CHECK-NEXT: DW_CFA_def_cfa_offset: +16
# CHECK-NEXT: DW_CFA_offset: reg6 -16
# CHECK-NEXT: DW_CFA_advance_loc: 3
# CHECK-NEXT: DW_CFA_def_cfa_register: reg6
# CHECK-NEXT: DW_CFA_advance_loc: 2
# CHECK-NEXT: DW_CFA_offset: reg15 -24
# CHECK-NEXT: DW_CFA_advance_loc: 5
# CHECK-NEXT: DW_CFA_offset: reg14 -32
# CHECK-NEXT: DW_CFA_advance_loc: 7
# CHECK-NEXT: DW_CFA_offset: reg13 -40
# CHECK-NEXT: DW_CFA_offset: reg12 -48
# CHECK-NEXT: DW_CFA_advance_loc: 8
# CHECK-NEXT: DW_CFA_offset: reg3 -56
# CHECK-NEXT: DW_CFA_advance_loc1: 75
# CHECK-NEXT: DW_CFA_def_cfa: reg7 +8
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK: [0x4014f0] FDE length=20 cie=[0x401430]
# CHECK-NEXT: initial_location: 0x4012c0
# CHECK-NEXT: address_range: 0x1 (end : 0x4012c1)
# CHECK: Program:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
# CHECK-NEXT: DW_CFA_nop:
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Entry: 0x0000000000400000
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x0000000000400000
AddressAlign: 16
Content: 50C704240020400031C05AC3
- Name: .eh_frame_hdr
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
Address: 0x00000000004013c0
AddressAlign: 4
Content: 011B033B3C00000006000000E0F0FFFF8800000010F1FFFF58000000F6F1FFFFB000000010F2FFFFD000000090FEFFFF0001000000FFFFFF30010000
- Name: .eh_frame
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
Address: 0x0000000000401400
AddressAlign: 8
Content: 1400000000000000017A5200017810011B0C070890010710140000001C000000B0F0FFFF2A00000000000000000000001400000000000000017A5200017810011B0C070890010000240000001C00000050F0FFFF20000000000E10460E184A0F0B770880003F1A3B2A332422000000001C000000440000003EF1FFFF1000000000410E108602430D064B0C07080000002C0000006400000038F1FFFF7F0C000000450C0A00491006027600450F0376780603660C0C0A00450C070800000000002C0000009400000088FDFFFF6600000000410E108602430D06428F03458E04478D058C06488307024B0C07080000000014000000C4000000C8FDFFFF01000000000000000000000000000000
Symbols:
- Name: myfunc
Type: STT_FUNC
Section: .text
Value: 0x0000000000400000
Binding: STB_GLOBAL
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_X, PF_R ]
VAddr: 0x00400000
PAddr: 0x00400000
Sections:
- Section: .text
- Type: PT_GNU_EH_FRAME
Flags: [ PF_X, PF_R ]
VAddr: 0x004013C0
PAddr: 0x004013C0
Sections:
- Section: .eh_frame_hdr
...