local ElfConstants = { }

ElfConstants.classtypes = { Class32 = 1,
                            Class64 = 2 }

ElfConstants.datatypes = { Data2LSB = 1,
                           Data2MSB = 2 }

ElfConstants.abiname = { [0]   = "System V",
                         [1]   = "Hewlett-Packard HP-UX",
                         [2]   = "NetBSD",
                         [3]   = "Linux",
                         [4]   = "Unknown4",
                         [5]   = "Unknown5",
                         [6]   = "Sun Solaris",
                         [7]   = "Aix",
                         [8]   = "Irix",
                         [9]   = "FreeBSD",
                         [10]  = "Compaq TRU64 Unix",
                         [11]  = "Novell Modesto",
                         [12]  = "OpenBSD",
                         [13]  = "OpenVMS",
                         [14]  = "Hewlett-Packard Non-Stop Kernel",
                         [15]  = "Amiga Research OS",
                         [97]  = "ARM",
                         [255] = "Standalone (Embedded) Application" }

ElfConstants.elftype = { [0] = "Unknown",
                         [1] = "Relocatable",
                         [2] = "Executable",
                         [3] = "Shared Object",
                         [4] = "Core File" }

ElfConstants.elfmachine = { [0]  = "Unknown",
                            [1]  = "AT&T WE 32100",
                            [2]  = "Sun SPARC",
                            [3]  = "Intel 80386",
                            [4]  = "Motorola 68000",
                            [5]  = "Motorola 88000",
                            [6]  = "Intel 80486",
                            [7]  = "Intel i860",
                            [8]  = "MIPS RS3000", -- Big Endian?
                            [9]  = "IBM System/370 Processor",
                            [10] = "MIPS RS3000 Little-Endian",
                            [11] = "RS6000",
                            [15] = "PA-RISC",
                            [16] = "nCUBE",
                            [17] = "Fujitsu VPP500",
                            [18] = "Sun SPARC 32+",
                            [19] = "Intel 80960",
                            [20] = "PowerPC",
                            [21] = "64-bit PowerPC",
                            [22] = "IBM System/390 Processor",
                            [36] = "NEX V800",
                            [37] = "Fujitsu FR20",
                            [38] = "TRW RH-32",
                            [39] = "Motorola RCE",
                            [40] = "Advanced RISC Marchines ARM",
                            [41] = "Digital Alpha",
                            [42] = "Hitachi SH",
                            [43] = "Sun SPARC V9 (64-bit)",
                            [44] = "Siemens Tricore embedded processor",
                            [45] = "Argonaut RISC Core (Argonaut Technologies Inc.)",
                            [46] = "Hitachi H8/300",
                            [47] = "Hitachi H8/300H",
                            [48] = "Hitachi H8S",
                            [49] = "Hitachi H8/500",
                            [50] = "Intel IA64",
                            [51] = "Stanford MIPS-X",
                            [52] = "Motorola ColdFire",
                            [53] = "Motorola M68HC12",
                            [54] = "Fujitsu MMA Mulimedia Accelerator",
                            [55] = "Siemens PCP",
                            [56] = "Sony nCPU embedded RISC processor",
                            [57] = "Denso NDR1 microprocessor",
                            [58] = "Motorola Star*Core processor",
                            [59] = "Toyota ME16 processor",
                            [60] = "STMicroelectronics ST100 processor",
                            [61] = "Advanced Logic Corp. TinyJ (Embedded Processor Family)",
                            [62] = "AMDs x86-64 architecture",
                            [63] = "Sony DSP Processor",
                            [66] = "Siemens FX66 microcontroller",
                            [67] = "STMicroelectronics ST9+8/16 bit (Microcontroller)",
                            [68] = "STMicroelectronics ST7 8-bit (Microcontroller)",
                            [69] = "Motorola MC68HC16 Microcontroller",
                            [70] = "Motorola MC68HC11 Microcontroller",
                            [71] = "Motorola MC68HC08 Microcontroller",
                            [72] = "Motorola MC68HC05 Microcontroller",
                            [73] = "Silicon Graphics SVx",
                            [74] = "STMicroelectronics ST19 8-bit (Microcontroller)",
                            [75] = "Digital VAX",
                            [76] = "Axis Communications 32-bit (Embedded Processor)",
                            [77] = "Infineon Technologies 32-bit (Embedded Processor)",
                            [78] = "Element 14 64-bit DSP Processor",
                            [79] = "LSI Logic 16-bit DSP Processor",
                            [80] = "Donald Knuth's educational (64-bit Processor)",
                            [81] = "Harvard University (Machine Independent)",
                            [82] = "SiTera Prism",
                            [83] = "Atmel AVR 8-bit microcontroller",
                            [84] = "Fujitsu FR30",
                            [85] = "Mitsubishi D10V",
                            [86] = "Mitsubishi D30V",
                            [87] = "NEC v850",
                            [88] = "Mitsubishi M32R",
                            [89] = "Matsushita MN10300",
                            [90] = "Matsushita MN10200",
                            [91] = "picoJava",
                            [92] = "OpenRISC 32-bit embedded processor",
                            [93] = "ARC Cores Tangent-A5",
                            [94] = "Tensilica Xtensa architecture" }

ElfConstants.programheadertype = { [0x00000000] = "NULL",
                                   [0x00000001] = "LOAD",
                                   [0x00000002] = "DYNAMIC",
                                   [0x00000003] = "INTERP",
                                   [0x00000004] = "NOTE",
                                   [0x00000005] = "SHLIB",
                                   [0x00000006] = "PHDR",
                                   [0x00000007] = "TLS",
                                   [0x6474E550] = "GNU_EH_FRAME",
                                   [0x6474E551] = "GNU_STACK",
                                   [0x6474E552] = "GNU_RELRO" }

ElfConstants.programheaderflags = { Executable = 0x1,
                                    Writable   = 0x2,
                                    Readable   = 0x4 }

ElfConstants.sectionheadertypes = { Null     = 0,
                                    ProgBits = 1,
                                    SymTab   = 2,
                                    StrTab   = 3,
                                    Rela     = 4,
                                    Hash     = 5,
                                    Dynamic  = 6,
                                    Note     = 7,
                                    NoBits   = 8,
                                    Rel      = 9,
                                    ShLib    = 10,
                                    DynSym   = 11 }
                                    
ElfConstants.sectionheadertypenames = { [0]  = "NULL",
                                        [1]  = "PROGBITS",
                                        [2]  = "SYMTAB",
                                        [3]  = "STRTAB",
                                        [4]  = "RELA",
                                        [5]  = "HASH",
                                        [6]  = "DYNAMIC",
                                        [7]  = "NOTE",
                                        [8]  = "NOBITS",
                                        [9]  = "REL",
                                        [10] = "SHLIB",
                                        [11] = "DYNSYM" }

ElfConstants.sectionheaderflags = { Write            = 0x1,
                                    Alloc            = 0x2,
                                    ExeInstr         = 0x4,
                                    Merge            = 0x10,
                                    Strings          = 0x20,
                                    LinkInfo         = 0x40,
                                    LinkOrder        = 0x80,
                                    NonConforming    = 0x100,
                                    Group            = 0x200,
                                    Tls              = 0x400,
                                    Compressed       = 0x800 }

return ElfConstants
