diff options
Diffstat (limited to 'spec/elf.fspec')
-rw-r--r-- | spec/elf.fspec | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/spec/elf.fspec b/spec/elf.fspec index 5bd9954..85c4fe7 100644 --- a/spec/elf.fspec +++ b/spec/elf.fspec @@ -1,13 +1,7 @@ -struct elf32 { - u32 e_entry hex; - u32 e_phoff; - u32 e_shoff; -}; - -struct elf64 { - u64 e_entry hex; - u64 e_phoff; - u64 e_shoff; +enum { + CLASS_NONE, + CLASS_32, + CLASS_64 }; struct elf { @@ -22,8 +16,16 @@ struct elf { u16 e_machine hex; u32 e_version; select (ei_class) { - 1) struct elf32 elf32; - 2) struct elf64 elf64; + CLASS_32) struct { + u32 e_entry hex; + u32 e_phoff; + u32 e_shoff; + } elf32; + CLASS_64) struct { + u64 e_entry hex; + u64 e_phoff; + u64 e_shoff; + } elf64; } arch; u32 e_flags hex; u16 e_ehsz; |