diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-09-26 16:02:58 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-09-26 16:02:58 +0300 |
commit | fd170f09fb2a95e29a9a4c71e18baa265577e18b (patch) | |
tree | a3de181650b930e098c7036a1e950a4ac3733615 | |
parent | 633e1675839b0dc6484a6b9ca4b3a68e3a3be8f6 (diff) |
Nicer elf spec
-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; |