1
1
/// A CPU architecture.
2
2
#[ allow( missing_docs) ]
3
3
#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
4
+ #[ non_exhaustive]
4
5
pub enum Architecture {
5
6
Unknown ,
6
7
Aarch64 ,
7
8
Arm ,
8
9
I386 ,
9
10
Mips ,
10
11
Mips64 ,
11
- S390x ,
12
- Wasm32 ,
13
12
PowerPc ,
14
13
PowerPc64 ,
15
14
Riscv32 ,
16
15
Riscv64 ,
16
+ S390x ,
17
+ Wasm32 ,
17
18
X86_64 ,
18
19
}
19
20
@@ -29,13 +30,13 @@ impl Architecture {
29
30
Architecture :: I386 => Some ( AddressSize :: U32 ) ,
30
31
Architecture :: Mips => Some ( AddressSize :: U32 ) ,
31
32
Architecture :: Mips64 => Some ( AddressSize :: U64 ) ,
32
- Architecture :: S390x => Some ( AddressSize :: U64 ) ,
33
- Architecture :: Wasm32 => Some ( AddressSize :: U32 ) ,
34
- Architecture :: X86_64 => Some ( AddressSize :: U64 ) ,
35
33
Architecture :: PowerPc => Some ( AddressSize :: U32 ) ,
36
34
Architecture :: PowerPc64 => Some ( AddressSize :: U64 ) ,
37
- Architecture :: Riscv64 => Some ( AddressSize :: U64 ) ,
38
35
Architecture :: Riscv32 => Some ( AddressSize :: U32 ) ,
36
+ Architecture :: Riscv64 => Some ( AddressSize :: U64 ) ,
37
+ Architecture :: S390x => Some ( AddressSize :: U64 ) ,
38
+ Architecture :: Wasm32 => Some ( AddressSize :: U32 ) ,
39
+ Architecture :: X86_64 => Some ( AddressSize :: U64 ) ,
39
40
}
40
41
}
41
42
}
@@ -45,6 +46,7 @@ impl Architecture {
45
46
/// This may differ from the address size supported by the file format (such as for COFF).
46
47
#[ allow( missing_docs) ]
47
48
#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
49
+ #[ non_exhaustive]
48
50
#[ repr( u8 ) ]
49
51
pub enum AddressSize {
50
52
U32 = 4 ,
@@ -62,6 +64,7 @@ impl AddressSize {
62
64
/// A binary file format.
63
65
#[ allow( missing_docs) ]
64
66
#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
67
+ #[ non_exhaustive]
65
68
pub enum BinaryFormat {
66
69
Coff ,
67
70
Elf ,
@@ -72,6 +75,7 @@ pub enum BinaryFormat {
72
75
73
76
/// The kind of a section.
74
77
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
78
+ #[ non_exhaustive]
75
79
pub enum SectionKind {
76
80
/// The section kind is unknown.
77
81
Unknown ,
@@ -170,6 +174,7 @@ impl SectionKind {
170
174
/// This determines the way in which the linker resolves multiple definitions of the COMDAT
171
175
/// sections.
172
176
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
177
+ #[ non_exhaustive]
173
178
pub enum ComdatKind {
174
179
/// The selection kind is unknown.
175
180
Unknown ,
@@ -201,6 +206,7 @@ pub enum ComdatKind {
201
206
202
207
/// The kind of a symbol.
203
208
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
209
+ #[ non_exhaustive]
204
210
pub enum SymbolKind {
205
211
/// The symbol kind is unknown.
206
212
Unknown ,
@@ -249,6 +255,7 @@ pub enum SymbolScope {
249
255
///
250
256
/// 'XxxRelative' means 'Xxx + A - P'. 'XxxOffset' means 'S + A - Xxx'.
251
257
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
258
+ #[ non_exhaustive]
252
259
pub enum RelocationKind {
253
260
/// S + A
254
261
Absolute ,
@@ -288,6 +295,7 @@ pub enum RelocationKind {
288
295
/// This is usually architecture specific, such as specifying an addressing mode or
289
296
/// a specific instruction.
290
297
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
298
+ #[ non_exhaustive]
291
299
pub enum RelocationEncoding {
292
300
/// Generic encoding.
293
301
Generic ,
@@ -317,6 +325,7 @@ pub enum RelocationEncoding {
317
325
318
326
/// File flags that are specific to each file format.
319
327
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
328
+ #[ non_exhaustive]
320
329
pub enum FileFlags {
321
330
/// No file flags.
322
331
None ,
@@ -339,6 +348,7 @@ pub enum FileFlags {
339
348
340
349
/// Section flags that are specific to each file format.
341
350
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
351
+ #[ non_exhaustive]
342
352
pub enum SectionFlags {
343
353
/// No section flags.
344
354
None ,
@@ -361,6 +371,7 @@ pub enum SectionFlags {
361
371
362
372
/// Symbol flags that are specific to each file format.
363
373
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
374
+ #[ non_exhaustive]
364
375
pub enum SymbolFlags < Section > {
365
376
/// No symbol flags.
366
377
None ,
0 commit comments