[Wisp-cvs] wisp/users/dig elf.py,NONE,1.1 Makefile.am,1.1,1.2
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-02-06 21:05:43
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv24521 Modified Files: Makefile.am Added Files: elf.py Log Message: added elf.py --- NEW FILE: elf.py --- #### elf.py - ELF constants # # Copyleft © 2003 by Andres Soolo (di...@us...) # This file is licensed under the GNU GPL v2. If you # don't know what that means, please do read the GPL. # #### @(#) $Id: elf.py,v 1.1 2003/02/06 21:05:38 digg Exp $ class ET: # Legal values for e_type (object file type). NONE = 0 # No file type REL = 1 # Relocatable file EXEC = 2 # Executable file DYN = 3 # Shared object file CORE = 4 # Core file NUM = 5 # Number of defined types LOOS = 0xfe00 # OS-specific range start HIOS = 0xfeff # OS-specific range end LOPROC = 0xff00 # Processor-specific range start HIPROC = 0xffff # Processor-specific range end class EM: # Legal values for e_machine (architecture). NONE = 0 # No machine M32 = 1 # AT&T WE 32100 SPARC = 2 # SUN SPARC I386 = 3 # Intel 80386 M68K = 4 # Motorola m68k family M88K = 5 # Motorola m88k family I860 = 7 # Intel 80860 MIPS = 8 # MIPS R3000 big-endian S370 = 9 # IBM System/370 MIPS_RS3_LE = 10 # MIPS R3000 little-endian PARISC = 15 # HPPA VPP500 = 17 # Fujitsu VPP500 SPARC32PLUS = 18 # Sun's "v8plus" I960 = 19 # Intel 80960 PPC = 20 # PowerPC PPC64 = 21 # PowerPC 64-bit S390 = 22 # IBM S390 V800 = 36 # NEC V800 series FR20 = 37 # Fujitsu FR20 RH32 = 38 # TRW RH-32 RCE = 39 # Motorola RCE ARM = 40 # ARM FAKE_ALPHA = 41 # Digital Alpha SH = 42 # Hitachi SH SPARCV9 = 43 # SPARC v9 64-bit TRICORE = 44 # Siemens Tricore ARC = 45 # Argonaut RISC Core H8_300 = 46 # Hitachi H8/300 H8_300H = 47 # Hitachi H8/300H H8S = 48 # Hitachi H8S H8_500 = 49 # Hitachi H8/500 IA_64 = 50 # Intel Merced MIPS_X = 51 # Stanford MIPS-X COLDFIRE = 52 # Motorola Coldfire M68HC12 = 53 # Motorola M68HC12 MMA = 54 # Fujitsu MMA Multimedia Accelerator PCP = 55 # Siemens PCP NCPU = 56 # Sony nCPU embeeded RISC NDR1 = 57 # Denso NDR1 microprocessor STARCORE = 58 # Motorola Start*Core processor ME16 = 59 # Toyota ME16 processor ST100 = 60 # STMicroelectronic ST100 processor TINYJ = 61 # Advanced Logic Corp. Tinyj emb.fam X86_64 = 62 # AMD x86-64 architecture PDSP = 63 # Sony DSP Processor FX66 = 66 # Siemens FX66 microcontroller ST9PLUS = 67 # STMicroelectronics ST9+ 8/16 mc ST7 = 68 # STmicroelectronics ST7 8 bit mc MC68HC16 = 69 # Motorola MC68HC16 microcontroller MC68HC11 = 70 # Motorola MC68HC11 microcontroller MC68HC08 = 71 # Motorola MC68HC08 microcontroller MC68HC05 = 72 # Motorola MC68HC05 microcontroller SVX = 73 # Silicon Graphics SVx AT19 = 74 # STMicroelectronics ST19 8 bit mc VAX = 75 # Digital VAX CRIS = 76 # Axis Communications 32-bit embedded processor JAVELIN = 77 # Infineon Technologies 32-bit embedded processor FIREPATH = 78 # Element 14 64-bit DSP Processor ZSP = 79 # LSI Logic 16-bit DSP Processor MMIX = 80 # Donald Knuth's educational 64-bit processor HUANY = 81 # Harvard University machine-independent object files PRISM = 82 # SiTera Prism AVR = 83 # Atmel AVR 8-bit microcontroller FR30 = 84 # Fujitsu FR30 D10V = 85 # Mitsubishi D10V D30V = 86 # Mitsubishi D30V V850 = 87 # NEC v850 M32R = 88 # Mitsubishi M32R MN10300 = 89 # Matsushita MN10300 MN10200 = 90 # Matsushita MN10200 PJ = 91 # picoJava OPENRISC = 92 # OpenRISC 32-bit embedded processor ARC_A5 = 93 # ARC Cores Tangent-A5 XTENSA = 94 # Tensilica Xtensa Architecture NUM = 95 class EV: # Legal values for e_version (version). NONE = 0 # Invalid ELF version CURRENT = 1 # Current version NUM = 2 class SHN: # Special section indices. UNDEF = 0 # Undefined section LORESERVE = 0xff00 # Start of reserved indices LOPROC = 0xff00 # Start of processor-specific HIPROC = 0xff1f # End of processor-specific LOOS = 0xff20 # Start of OS-specific HIOS = 0xff3f # End of OS-specific ABS = 0xfff1 # Associated symbol is absolute COMMON = 0xfff2 # Associated symbol is common XINDEX = 0xffff # Index is in extra table HIRESERVE = 0xffff # End of reserved indices class SHT: # Legal values for sh_type (section type). NULL = 0 # Section header table entry unused PROGBITS = 1 # Program data SYMTAB = 2 # Symbol table STRTAB = 3 # String table RELA = 4 # Relocation entries with addends HASH = 5 # Symbol hash table DYNAMIC = 6 # Dynamic linking information NOTE = 7 # Notes NOBITS = 8 # Program space with no data (bss) REL = 9 # Relocation entries, no addends SHLIB = 10 # Reserved DYNSYM = 11 # Dynamic linker symbol table INIT_ARRAY = 14 # Array of constructors FINI_ARRAY = 15 # Array of destructors PREINIT_ARRAY = 16 # Array of pre-constructors GROUP = 17 # Section group SYMTAB_SHNDX = 18 # Extended section indeces NUM = 19 # Number of defined types. LOOS = 0x60000000 # Start OS-specific GNU_LIBLIST = 0x6ffffff7 # Prelink library list CHECKSUM = 0x6ffffff8 # Checksum for DSO content. LOSUNW = 0x6ffffffa # Sun-specific low bound. SUNW_move = 0x6ffffffa SUNW_COMDAT = 0x6ffffffb SUNW_syminfo = 0x6ffffffc GNU_verdef = 0x6ffffffd # Version definition section. GNU_verneed = 0x6ffffffe # Version needs section. GNU_versym = 0x6fffffff # Version symbol table. HISUNW = 0x6fffffff # Sun-specific high bound. HIOS = 0x6fffffff # End OS-specific type LOPROC = 0x70000000 # Start of processor-specific HIPROC = 0x7fffffff # End of processor-specific LOUSER = 0x80000000 # Start of application-specific HIUSER = 0x8fffffff # End of application-specific class SHF: # Legal values for sh_flags (section flags). WRITE = 1 << 0 # Writable ALLOC = 1 << 1 # Occupies memory during execution EXECINSTR = 1 << 2 # Executable MERGE = 1 << 4 # Might be merged STRINGS = 1 << 5 # Contains nul-terminated strings INFO_LINK = 1 << 6 # `sh_info' contains SHT index LINK_ORDER = 1 << 7 # Preserve order after combining OS_NONCONFORMING = 1 << 8 # Non-standard OS specific handling # required GROUP = 1 << 9 # Section is member of a group. TLS = 1 << 10 # Section hold thread-local data. MASKOS = 0x0ff00000 # OS-specific. MASKPROC = 0xf0000000 # Processor-specific class GRP: # Section group handling. COMDAT = 0x1 # Mark group as COMDAT. class SYMINFO: class BT: # Possible values for si_boundto. SELF = 0xffff # Symbol bound to self PARENT = 0xfffe # Symbol bound to parent LOWRESERVE = 0xff00 # Beginning of reserved entries class FLG: # Possible bitmasks for si_flags. DIRECT = 0x0001 # Direct bound symbol PASSTHRU = 0x0002 # Pass-thru symbol for translator COPY = 0x0004 # Symbol is a copy-reloc LAZYLOAD = 0x0008 # Symbol bound to object to be lazy loaded # Syminfo version values. NONE = 0 CURRENT = 1 NUM = 2 class STB: # Legal values for ST_BIND subfield of st_info (symbol binding). LOCAL = 0 # Local symbol GLOBAL = 1 # Global symbol WEAK = 2 # Weak symbol NUM = 3 # Number of defined types. LOOS = 10 # Start of OS-specific HIOS = 12 # End of OS-specific LOPROC = 13 # Start of processor-specific HIPROC = 15 # End of processor-specific class STT: # Legal values for ST_TYPE subfield of st_info (symbol type). NOTYPE = 0 # Symbol type is unspecified OBJECT = 1 # Symbol is a data object FUNC = 2 # Symbol is a code object SECTION = 3 # Symbol associated with a section FILE = 4 # Symbol's name is file name COMMON = 5 # Symbol is a common data object NUM = 6 # Number of defined types. LOOS = 10 # Start of OS-specific HIOS = 12 # End of OS-specific LOPROC = 13 # Start of processor-specific HIPROC = 15 # End of processor-specific class STN: # Symbol table indices are found in the hash buckets and chain table # of a symbol hash table section. This special index value indicates # the end of a chain, meaning no further symbols are found in that bucket. UNDEF = 0 # End of a chain. class STV: # Symbol visibility specification encoded in the st_other field. DEFAULT = 0 # Default symbol visibility rules INTERNAL = 1 # Processor specific hidden class HIDDEN = 2 # Sym unavailable in other modules PROTECTED = 3 # Not preemptible, not exported class PT: # Legal values for p_type (segment type). NULL = 0 # Program header table entry unused LOAD = 1 # Loadable program segment DYNAMIC = 2 # Dynamic linking information INTERP = 3 # Program interpreter NOTE = 4 # Auxiliary information SHLIB = 5 # Reserved PHDR = 6 # Entry for header table itself TLS = 7 # Thread-local storage segment NUM = 8 # Number of defined types LOOS = 0x60000000 # Start of OS-specific GNU_EH_FRAME = 0x6474e550 # GCC .eh_frame_hdr segment HIOS = 0x6fffffff # End of OS-specific LOPROC = 0x70000000 # Start of processor-specific HIPROC = 0x7fffffff # End of processor-specific class PF: # Legal values for p_flags (segment flags). X = 1 << 0 # Segment is executable W = 1 << 1 # Segment is writable R = 1 << 2 # Segment is readable MASKOS = 0x0ff00000 # OS-specific MASKPROC = 0xf0000000 # Processor-specific class NT: # Legal values for note segment descriptor types for core files. PRSTATUS = 1 # Contains copy of prstatus struct FPREGSET = 2 # Contains copy of fpregset struct PRPSINFO = 3 # Contains copy of prpsinfo struct PRXREG = 4 # Contains copy of prxregset struct PLATFORM = 5 # String from sysinfo(SI_PLATFORM) AUXV = 6 # Contains copy of auxv array GWINDOWS = 7 # Contains copy of gwindows struct PSTATUS = 10 # Contains copy of pstatus struct PSINFO = 13 # Contains copy of psinfo struct PRCRED = 14 # Contains copy of prcred struct UTSNAME = 15 # Contains copy of utsname struct LWPSTATUS = 16 # Contains copy of lwpstatus struct LWPSINFO = 17 # Contains copy of lwpinfo struct PRFPXREG = 20 # Contains copy of fprxregset struct # Legal values for the note segment descriptor types for object files. VERSION = 1 # Contains a version string. class DT: # Legal values for d_tag (dynamic entry type). NULL = 0 # Marks end of dynamic section NEEDED = 1 # Name of needed library PLTRELSZ = 2 # Size in bytes of PLT relocs PLTGOT = 3 # Processor defined value HASH = 4 # Address of symbol hash table STRTAB = 5 # Address of string table SYMTAB = 6 # Address of symbol table RELA = 7 # Address of Rela relocs RELASZ = 8 # Total size of Rela relocs RELAENT = 9 # Size of one Rela reloc STRSZ = 10 # Size of string table SYMENT = 11 # Size of one symbol table entry INIT = 12 # Address of init function FINI = 13 # Address of termination function SONAME = 14 # Name of shared object RPATH = 15 # Library search path (deprecated) SYMBOLIC = 16 # Start symbol search here REL = 17 # Address of Rel relocs RELSZ = 18 # Total size of Rel relocs RELENT = 19 # Size of one Rel reloc PLTREL = 20 # Type of reloc in PLT DEBUG = 21 # For debugging; unspecified TEXTREL = 22 # Reloc might modify .text JMPREL = 23 # Address of PLT relocs BIND_NOW = 24 # Process relocations of object INIT_ARRAY = 25 # Array with addresses of init fct FINI_ARRAY = 26 # Array with addresses of fini fct INIT_ARRAYSZ = 27 # Size in bytes of DT_INIT_ARRAY FINI_ARRAYSZ = 28 # Size in bytes of DT_FINI_ARRAY RUNPATH = 29 # Library search path FLAGS = 30 # Flags for the object being loaded ENCODING = 32 # Start of encoded range PREINIT_ARRAY = 32 # Array with addresses of preinit fct PREINIT_ARRAYSZ = 33 # size in bytes of DT_PREINIT_ARRAY NUM = 34 # Number used LOOS = 0x60000000 # Start of OS-specific HIOS = 0x6fffffff # End of OS-specific LOPROC = 0x70000000 # Start of processor-specific HIPROC = 0x7fffffff # End of processor-specific # Intel 80386 specific definitions. class RELOC: class I386: NONE = 0 # No reloc D32 = 1 # Direct 32 bit PC32 = 2 # PC relative 32 bit GOT32 = 3 # 32 bit GOT entry PLT32 = 4 # 32 bit PLT address COPY = 5 # Copy symbol at runtime GLOB_DAT = 6 # Create GOT entry JMP_SLOT = 7 # Create PLT entry RELATIVE = 8 # Adjust by program base GOTOFF = 9 # 32 bit offset to GOT GOTPC = 10 # 32 bit PC relative offset to GOT # Keep this the last entry. NUM = 11 Index: Makefile.am =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 6 Feb 2003 20:11:39 -0000 1.1 +++ Makefile.am 6 Feb 2003 21:05:38 -0000 1.2 @@ -6,6 +6,6 @@ # #### @(#) $Id$ -EXTRA_DIST = .cvsignore struburn.wisp linkie.py makehello.py +EXTRA_DIST = .cvsignore struburn.wisp elf.py linkie.py makehello.py all: |