diff --git a/lib/elf/eheader.h b/lib/elf/eheader.h index 5b45703..96df3fa 100644 --- a/lib/elf/eheader.h +++ b/lib/elf/eheader.h @@ -45,17 +45,18 @@ typedef struct { Elf64_Half e_shstrndx; } Elf64_Ehdr; -/* == ElfXX_Ehdr.e_ident[] == +/* == ElfN_Ehdr.e_ident[] == * EI_* macros define indexes into this this, and are followed * by a series a macros defining legal values for that index. */ -# define E_IDENT_DESC ( \ - "The initial bytes of an ELF file. Marking it as an object file " \ - "and providing machine-independent data with which to decode " \ - "and interpret the file’s contents." +/* XXX: WARNING: TODO :WARNING :XXX */ +# define E_IDENT_DESC ( \ + "The initial bytes of an ELF file.\n\n" \ + "Marks the file as an object file and provides machine-independent " \ + "data with which to parse and interpret the file’s contents." ) -/* == ElfXX_Ehdr.e_type == */ -enum e_type_t : Elf64_Addr { +/* == ElfN_Ehdr.e_type == */ +enum e_type_t { ET_NONE = 0, /* No file type */ ET_REL = 1, /* Relocatable file */ ET_EXEC = 2, /* Executable file */ @@ -66,6 +67,37 @@ enum e_type_t : Elf64_Addr { ET_LOPROC = 0xff00, /* Processor-specific range start */ ET_HIPROC = 0xffff, /* Processor-specific range end */ }; +# define E_TYPE_DESC ( \ + "Identifies the object file type.\n\n" \ + "ET_CORE is reserved and largely used by core files. " \ + "However the actual file contents are left unspecified. " \ + "Allowing projects to define their own extensions.\n\n" \ + "Values ET_LOOS through ET_HIOS (inclusive) are reserved " \ + "for OS-specific object file types.\n\n" \ + "Values ET_LOPROC through ET_HIPROC (inclusive) are reserved " \ + "for processor-specific object file types." ) +/* == ElfN_Ehdr.e_machine == */ +enum e_machine_t { + /* XXX: WARNING: TODO :WARNING :XXX */ +}; +#define E_MACHINE_DESC () + +/* == ElfN_Ehdr.e_version == */ +enum e_version_t { + EV_NONE = 0, /* Invalid version */ + EV_CURRENT = 1, /* Current Version */ +}; +#define E_VERSION_DESC ( \ + "Version of ELF used.\n\n" \ + "EV_CURRENT signifies the original file format. " \ + "Extensions will use higher e_machine numbers" ) + +/* == ElfN_Ehdr.e_entry == */ +#define E_ENTRY_DESC ( \ + "Virtual address of the entry point.\n\n" \ + "The system first transfers control to this virtual address, " \ + "thus starting the process. If the file has no associated entry point, " \ + "this member holds zero." ) #endif /* BFPG_ELF_HEADER_H */