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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
| # Show that all regular section types are properly printed for both LLVM and
# GNU styles.
# RUN: yaml2obj %s -o %t-basic.o
# RUN: llvm-readobj --section-headers %t-basic.o | FileCheck %s --check-prefix=LLVM
# RUN: llvm-readelf --section-headers %t-basic.o | FileCheck %s --check-prefix=GNU
# LLVM: Name: (0)
# LLVM: Type: SHT_NULL
# LLVM: Name: progbits
# LLVM: Type: SHT_PROGBITS
# LLVM: Name: rela
# LLVM: Type: SHT_RELA
# LLVM: Name: hash
# LLVM: Type: SHT_HASH
# LLVM: Name: dynamic
# LLVM: Type: SHT_DYNAMIC
# LLVM: Name: note
# LLVM: Type: SHT_NOTE
# LLVM: Name: nobits
# LLVM: Type: SHT_NOBITS
# LLVM: Name: rel
# LLVM: Type: SHT_REL
# LLVM: Name: shlib
# LLVM: Type: SHT_SHLIB
# LLVM: Name: dynsym
# LLVM: Type: SHT_DYNSYM
# LLVM: Name: init_array
# LLVM: Type: SHT_INIT_ARRAY
# LLVM: Name: fini_array
# LLVM: Type: SHT_FINI_ARRAY
# LLVM: Name: preinit_array
# LLVM: Type: SHT_PREINIT_ARRAY
# LLVM: Name: group
# LLVM: Type: SHT_GROUP
# LLVM: Name: symtab_shndx
# LLVM: Type: SHT_SYMTAB_SHNDX
# LLVM: Name: relr
# LLVM: Type: SHT_RELR
# LLVM: Name: android_rel
# LLVM: Type: SHT_ANDROID_REL
# LLVM: Name: android_rela
# LLVM: Type: SHT_ANDROID_RELA
# LLVM: Name: android_relr
# LLVM: Type: SHT_ANDROID_RELR
# LLVM: Name: llvm_odrtab
# LLVM: Type: SHT_LLVM_ODRTAB
# LLVM: Name: linker_options
# LLVM: Type: SHT_LLVM_LINKER_OPTIONS
# LLVM: Name: llvm_call_graph_profile
# LLVM: Type: SHT_LLVM_CALL_GRAPH_PROFILE
# LLVM: Name: llvm_addrsig
# LLVM: Type: SHT_LLVM_ADDRSIG
# LLVM: Name: .deplibs
# LLVM: Type: SHT_LLVM_DEPENDENT_LIBRARIES
# LLVM: Name: .llvm_sympart.f
# LLVM: Type: SHT_LLVM_SYMPART
# LLVM: Name: part1
# LLVM: Type: SHT_LLVM_PART_EHDR
# LLVM: Name: .phdrs
# LLVM: Type: SHT_LLVM_PART_PHDR
# LLVM: Name: gnu_attributes
# LLVM: Type: SHT_GNU_ATTRIBUTES
# LLVM: Name: gnu_hash
# LLVM: Type: SHT_GNU_HASH
# LLVM: Name: gnu_verdef
# LLVM: Type: SHT_GNU_verdef
# LLVM: Name: gnu_verneed
# LLVM: Type: SHT_GNU_verneed
# LLVM: Name: unknown
# LLVM: Type: Unknown (0x1000)
# LLVM: Name: loos
# LLVM: Type: Unknown (0x60000000)
# LLVM: Name: fooos
# LLVM: Type: Unknown (0x60000F00)
# LLVM: Name: hios
# LLVM: Type: SHT_GNU_versym
# LLVM: Name: loproc
# LLVM: Type: Unknown (0x70000000)
# LLVM: Name: fooproc
# LLVM: Type: Unknown (0x70000F00)
# LLVM: Name: hiproc
# LLVM: Type: Unknown (0x7FFFFFFF)
# LLVM: Name: louser
# LLVM: Type: Unknown (0x80000000)
# LLVM: Name: foouser
# LLVM: Type: Unknown (0x80000F00)
# LLVM: Name: hiuser
# LLVM: Type: Unknown (0xFFFFFFFF)
# LLVM: Name: .symtab
# LLVM: Type: SHT_SYMTAB
# LLVM: Name: .strtab
# LLVM: Type: SHT_STRTAB
# GNU: [ 0] NULL
# GNU-NEXT: progbits PROGBITS
# GNU-NEXT: rela RELA
# GNU-NEXT: hash HASH
# GNU-NEXT: dynamic DYNAMIC
# GNU-NEXT: note NOTE
# GNU-NEXT: nobits NOBITS
# GNU-NEXT: rel REL
# GNU-NEXT: shlib SHLIB
# GNU-NEXT: dynsym DYNSYM
# GNU-NEXT: init_array INIT_ARRAY
# GNU-NEXT: fini_array FINI_ARRAY
# GNU-NEXT: preinit_array PREINIT_ARRAY
# GNU-NEXT: group GROUP
# GNU-NEXT: symtab_shndx SYMTAB SECTION INDICES
# GNU-NEXT: relr RELR
# GNU-NEXT: android_rel ANDROID_REL
# GNU-NEXT: android_rela ANDROID_RELA
# GNU-NEXT: android_relr RELR
# GNU-NEXT: llvm_odrtab LLVM_ODRTAB
# GNU-NEXT: linker_options LLVM_LINKER_OPTIONS
# GNU-NEXT: llvm_call_graph_profile LLVM_CALL_GRAPH_PROFILE
# GNU-NEXT: llvm_addrsig LLVM_ADDRSIG
# GNU-NEXT: .deplibs LLVM_DEPENDENT_LIBRARIES
# GNU-NEXT: .llvm_sympart.f LLVM_SYMPART
# GNU-NEXT: part1 LLVM_PART_EHDR
# GNU-NEXT: .phdrs LLVM_PART_PHDR
# GNU-NEXT: gnu_attributes ATTRIBUTES
# GNU-NEXT: gnu_hash GNU_HASH
# GNU-NEXT: gnu_verdef VERDEF
# GNU-NEXT: gnu_verneed VERNEED
# GNU-NEXT: unknown 0x1000: <unknown>
# GNU-NEXT: loos LOOS+0x0
# GNU-NEXT: fooos LOOS+0xF00
# GNU-NEXT: hios VERSYM
# GNU-NEXT: loproc LOPROC+0x0
# GNU-NEXT: fooproc LOPROC+0xF00
# GNU-NEXT: hiproc LOPROC+0xFFFFFFF
# GNU-NEXT: louser LOUSER+0x0
# GNU-NEXT: foouser LOUSER+0xF00
# GNU-NEXT: hiuser LOUSER+0x7FFFFFFF
# GNU-NEXT: .symtab SYMTAB
# GNU-NEXT: .strtab STRTAB
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: progbits
Type: SHT_PROGBITS
- Name: rela
Type: SHT_RELA
Info: progbits
- Name: hash
Type: SHT_HASH
Content: ''
- Name: dynamic
Type: SHT_DYNAMIC
- Name: note
Type: SHT_NOTE
Notes: []
- Name: nobits
Type: SHT_NOBITS
- Name: rel
Type: SHT_REL
Info: progbits
- Name: shlib
Type: SHT_SHLIB
- Name: dynsym
Type: SHT_DYNSYM
Link: .strtab
- Name: init_array
Type: SHT_INIT_ARRAY
- Name: fini_array
Type: SHT_FINI_ARRAY
- Name: preinit_array
Type: SHT_PREINIT_ARRAY
- Name: group
Type: SHT_GROUP
Info: foo
Members:
- SectionOrType: 0
- Name: symtab_shndx
Type: SHT_SYMTAB_SHNDX
Link: .symtab
Entries: [ 0, 1 ]
- Name: relr
Type: SHT_RELR
- Name: android_rel
Type: SHT_ANDROID_REL
- Name: android_rela
Type: SHT_ANDROID_RELA
- Name: android_relr
Type: SHT_ANDROID_RELR
- Name: llvm_odrtab
Type: SHT_LLVM_ODRTAB
- Name: linker_options
Type: SHT_LLVM_LINKER_OPTIONS
- Name: llvm_call_graph_profile
Type: SHT_LLVM_CALL_GRAPH_PROFILE
- Name: llvm_addrsig
Type: SHT_LLVM_ADDRSIG
Symbols:
- Name: .deplibs
Type: SHT_LLVM_DEPENDENT_LIBRARIES
- Name: .llvm_sympart.f
Type: SHT_LLVM_SYMPART
- Name: part1
Type: SHT_LLVM_PART_EHDR
- Name: .phdrs
Type: SHT_LLVM_PART_PHDR
- Name: gnu_attributes
Type: SHT_GNU_ATTRIBUTES
- Name: gnu_hash
Type: SHT_GNU_HASH
- Name: gnu_verdef
Type: SHT_GNU_verdef
Info: 0
Entries:
- Name: gnu_verneed
Type: SHT_GNU_verneed
Info: 0
Dependencies:
- Name: unknown
Type: 0x1000
- Name: loos
Type: 0x60000000
- Name: fooos
Type: 0x60000F00
- Name: hios
Type: 0x6fffffff
Entries: []
- Name: loproc
Type: 0x70000000
- Name: fooproc
Type: 0x70000F00
- Name: hiproc
Type: 0x7fffffff
- Name: louser
Type: 0x80000000
- Name: foouser
Type: 0x80000F00
- Name: hiuser
Type: 0xffffffff
Symbols:
- Name: foo
Binding: STB_GLOBAL
|