Commits

insolor committed c911997

elf.e updated

Comments (0)

Files changed (1)

 -- Модуль работы с форматом Executable and Linkable Format
-
-constant EI_NIDENT = 16
+-- Based on http://www.skyfree.org/linux/references/ELF_Format.pdf
 
 -- Elf32_Ehdr
 public constant 
     E_SHNUM     = #30, -- + 2
     SIZEOF_EHDR = #32  -- 50
 
+-- Values of the e_type field
+public constant
+    ET_NONE     = 0, -- No file type
+    ET_REL      = 1, -- Relocatable file
+    ET_EXEC     = 2, -- Executable file
+    ET_DYN      = 3, -- Shared object file
+    ET_CORE     = 4, -- Core file
+    ET_LOPROC   = #FF00, -- Processor specific
+    ET_HIPROC   = #FFFF, -- Processor specific
+
+-- Values of the e_machine field
+public constant
+    EM_NONE     = 0, -- No machine
+    EM_M32      = 1, -- AT&T WE 32100
+    EM_SPARC    = 2, -- SPARC
+    EM_386      = 3, -- Intel 80386
+    EM_68K      = 4, -- Motorola 68000
+    EM_88K      = 5, -- Motorola 88000
+    EM_860      = 7, -- Intel 80860
+    EM_MIPS     = 8, -- MIPS RS3000
+
+public constant EV_NONE = 0, EV_CURRENT = 1
+
+-- Индексы в массиве e_ident, с учетом того, что индексация в Eu начинается с 1
+public enum
+    EI_MAG = 1, EI_MAG0 = 1, EI_MAG1, EI_MAG2, EI_MAG3, -- "\x7fELF"
+    EI_CLASS, EI_DATA, EI_VERSION, EI_PAD, EI_NIDENT = 16
+
+