unwind-non-relocatable.test
5.73 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
## Check that we dump the unwind information for a non-relocatable input properly.
## Check that we correctly decode function addresses and that we are able to
## locate corresponding STT_FUNC symbols and dump function names properly.
# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj -u %t | FileCheck --check-prefix=UNWIND %s
# RUN: llvm-readelf -u %t | FileCheck --check-prefix=UNWIND %s
# UNWIND: UnwindInformation {
# UNWIND-NEXT: UnwindIndexTable {
# UNWIND-NEXT: SectionIndex: 2
# UNWIND-NEXT: SectionName: .ARM.exidx
# UNWIND-NEXT: SectionOffset: 0x34
# UNWIND-NEXT: Entries [
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x230
# UNWIND-NEXT: FunctionName: func1
# UNWIND-NEXT: Model: Compact (Inline)
# UNWIND-NEXT: PersonalityIndex: 0
# UNWIND-NEXT: Opcodes [
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: ]
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x234
# UNWIND-NEXT: FunctionName: func2
# UNWIND-NEXT: Model: Compact (Inline)
# UNWIND-NEXT: PersonalityIndex: 0
# UNWIND-NEXT: Opcodes [
# UNWIND-NEXT: 0x9B ; vsp = r11
# UNWIND-NEXT: 0x84 0x80 ; pop {fp, lr}
# UNWIND-NEXT: ]
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x248
# UNWIND-NEXT: FunctionName: func3
# UNWIND-NEXT: Model: Compact (Inline)
# UNWIND-NEXT: PersonalityIndex: 0
# UNWIND-NEXT: Opcodes [
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: ]
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x24C
# UNWIND-NEXT: Model: CantUnwind
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x4000026B
# UNWIND-NEXT: FunctionName: func4
# UNWIND-NEXT: Model: Compact (Inline)
# UNWIND-NEXT: PersonalityIndex: 0
# UNWIND-NEXT: Opcodes [
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: 0xB0 ; finish
# UNWIND-NEXT: ]
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x25C
# UNWIND-NEXT: FunctionName: func5
# UNWIND-NEXT: ExceptionHandlingTable: .ARM.extab
# UNWIND-NEXT: TableEntryAddress: 0xAABE44
# UNWIND-NEXT: Model: Generic
# UNWIND-NEXT: PersonalityRoutineAddress: 0x33CCCF44
# UNWIND-NEXT: PersonalityRoutineName: personality1
# UNWIND-NEXT: }
# UNWIND-NEXT: Entry {
# UNWIND-NEXT: FunctionAddress: 0x25C
# UNWIND-NEXT: FunctionName: func5
# UNWIND-NEXT: ExceptionHandlingTable: .ARM.extab
# UNWIND-NEXT: TableEntryAddress: 0xAABE48
# UNWIND-NEXT: Model: Generic
# UNWIND-NEXT: PersonalityRoutineAddress: 0xFFFFFFFFF811138C
# UNWIND-NEXT: }
# UNWIND-NEXT: ]
# UNWIND-NEXT: }
# UNWIND-NEXT: }
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_ARM
Sections:
- Name: .text
Type: SHT_PROGBITS
Address: 0x230
- Name: .ARM.exidx
Type: SHT_ARM_EXIDX
Address: 0x24C
Entries:
## A. Address of .ARM.exidx (0x24C) + entry offset (0) + 0x7fffffe4 (31 bit) == 0x230 (func1).
- Offset: 0x7FFFFFE4
Value: 0x80B0B0B0 ## arbitrary opcodes.
## B. Address of .ARM.exidx (0x24C) + entry offset (8) + 0x7fffffe0 (31 bit) == 0x234 (func2).
- Offset: 0x7FFFFFE0
Value: 0x809B8480 ## arbitrary opcodes.
## C. Address of .ARM.exidx (0x24C) + entry offset (16) + 0x7fffffec (31 bit) == 0x248 (func3).
- Offset: 0x7FFFFFEC
Value: 0x80B0B0B0 ## arbitrary opcodes.
## D. Address of .ARM.exidx (0x24C) + entry offset (24) + 0x7fffffe8 (31 bit) == 0x24C.
- Offset: 0x7FFFFFE8
Value: EXIDX_CANTUNWIND
## E. Address of .ARM.exidx (0x24C) + entry offset (32) + 0x3FFFFFFF (31 bit) == 0x4000026b (func4).
- Offset: 0x3FFFFFFF
Value: 0x80B0B0B0 ## arbitrary opcodes.
## F. Address of .ARM.exidx (0x24C) + entry offset (40) + 0x7FFFFFE8 (31 bit) == 0x25c (func5).
- Offset: 0x7FFFFFE8
## Generic model. .ARM.exidx (0x24C) + entry offset (40 + 4) + 0x00AABBCC ==
## 0x00AABE44 == address of entry [0] in the .ARM.extab section.
## 0x00AABE44 + 0x33221100 (31 bit, signed, .ARM.extab entry [0] value) ==
## 0x33cccf44 == personality1 routine address.
Value: 0x00AABBCC
## G. Address of .ARM.exidx (0x24C) + entry offset (48) + 0x7FFFFFE0 (31 bit) == 0x25c (func5).
- Offset: 0x7FFFFFE0
## Generic model. .ARM.exidx (0x24C) + entry offset (48 + 4) + 0x00AABBC8 ==
## 0x00AABE48 == address of entry [1] in the .ARM.extab section.
## 0x00AABE48 + 0x77665544 (31 bit, signed, .ARM.extab entry [1] value) ==
## 0xFFFFFFFFF811138C == the address of a personality routine function that does not exist.
Value: 0x00AABBC8
- Name: .ARM.extab
Type: SHT_PROGBITS
Address: 0x00AABE44
Content: "0011223344556677"
Symbols:
- Name: func1
Type: STT_FUNC
Section: .text
Value: 0x230
- Name: func2
Type: STT_FUNC
Section: .text
Value: 0x234
- Name: func3
Type: STT_FUNC
Section: .text
Value: 0x248
- Name: func4
Type: STT_FUNC
Section: .text
Value: 0x4000026b
- Name: func5
Type: STT_FUNC
Section: .text
Value: 0x25c
- Name: personality1
Type: STT_FUNC
Value: 0x33cccf44