arm-exidx-section.yaml
3.15 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
## Check how obj2yaml dumps the SHT_ARM_EXIDX section.
## For a valid section, obj2yaml emits the "Entries" key.
## This checks that we respect data endianness and recognize the
## EXIDX_CANTUNWIND (0x1) special value properly.
# RUN: yaml2obj --docnum=1 -DENCODE=LSB %s -o %t.le.so
# RUN: obj2yaml %t.le.so | FileCheck %s --check-prefix=LE
# RUN: yaml2obj --docnum=1 -DENCODE=MSB %s -o %t.be.so
# RUN: obj2yaml %t.be.so | FileCheck %s --check-prefix=BE
# LE: - Name: .ARM.exidx
# LE-NEXT: Type: SHT_ARM_EXIDX
# LE-NEXT: Entries:
# LE-NEXT: - Offset: 0xDDCCBBAA
# LE-NEXT: Value: 0x01000000
# LE-NEXT: - Offset: 0x9988FFEE
# LE-NEXT: Value: EXIDX_CANTUNWIND
# LE-NEXT: ...
# BE: - Name: .ARM.exidx
# BE-NEXT: Type: SHT_ARM_EXIDX
# BE-NEXT: Entries:
# BE-NEXT: - Offset: 0xAABBCCDD
# BE-NEXT: Value: EXIDX_CANTUNWIND
# BE-NEXT: - Offset: 0xEEFF8899
# BE-NEXT: Value: 0x01000000
# BE-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2[[ENCODE=LSB]]
Type: ET_DYN
Machine: EM_ARM
Sections:
- Name: .ARM.exidx
Type: SHT_ARM_EXIDX
## 4 words: <arbitrary>, EXIDX_CANTUNWIND in big-endian,
## <arbitrary> and EXIDX_CANTUNWIND in little-endian.
Content: "AABBCCDD00000001EEFF889901000000"
Size: [[SIZE=<none>]]
## Check that we dump the content of a truncated SHT_ARM_EXIDX section
## using the "Content" key.
# RUN: yaml2obj --docnum=1 -DSIZE=17 %s -o %t.invalid-size.so
# RUN: obj2yaml %t.invalid-size.so | FileCheck %s --check-prefix=INVALID-SIZE
# INVALID-SIZE: - Name: .ARM.exidx
# INVALID-SIZE-NEXT: Type: SHT_ARM_EXIDX
# INVALID-SIZE-NEXT: Content: AABBCCDD00000001EEFF88990100000000
# INVALID-SIZE-NEXT: ...
## Check how we dump an empty SHT_ARM_EXIDX section.
# RUN: yaml2obj --docnum=2 %s -o %t.empty.so
# RUN: obj2yaml %t.empty.so | FileCheck %s --check-prefix=EMPTY
# EMPTY: - Name: .ARM.exidx
# EMPTY-NEXT: Type: SHT_ARM_EXIDX
# EMPTY-NEXT: Entries: []
# EMPTY-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: EM_ARM
Sections:
- Name: .ARM.exidx
Type: SHT_ARM_EXIDX
## Check how we dump the SHT_ARM_EXIDX (0x70000001) section when
## the machine type is not EM_ARM. It is dumped as a regular
## section of an unknown type.
# RUN: yaml2obj --docnum=3 %s -o %t.not-arm.so
# RUN: obj2yaml %t.not-arm.so | FileCheck %s --check-prefix=NOT-ARM
# RUN: yaml2obj --docnum=3 -DMACHINE=EM_ARM %s -o %t.arm.so
# RUN: obj2yaml %t.arm.so | FileCheck %s --check-prefix=ARM
# NOT-ARM: Sections:
# NOT-ARM-NEXT: - Name: .ARM.exidx
# NOT-ARM-NEXT: Type: 0x70000001
# NOT-ARM-NEXT: Content: AABBCCDD11223344
# NOT-ARM-NEXT: ...
# ARM: - Name: .ARM.exidx
# ARM-NEXT: Type: SHT_ARM_EXIDX
# ARM-NEXT: Entries:
# ARM-NEXT: - Offset: 0xDDCCBBAA
# ARM-NEXT: Value: 0x44332211
# ARM-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_DYN
Machine: [[MACHINE=<none>]]
Sections:
- Name: .ARM.exidx
Type: SHT_PROGBITS
ShType: 0x70000001 ## SHT_ARM_EXIDX
## An arbitrary valid content.
Content: "AABBCCDD11223344"