Вы находитесь на странице: 1из 2

// elf header char magic[4] ={ 0x7f, 'E', 'L', 'F' }; // EI_MAG, magic number (or "\17 7ELF"?

) char class = 1; // EI_CL ASS, 1 = 32 bit, 2 = 64 bit char byteorder = 2; // EI_DATA, 1 = little-endian, 2 = big-endian char hversion = 1; // EI_VE RSION, header version, always 1 char archtype = 20; // EI_OS ABI, architecture specific, check what we have for ppu char abiversion = 1; // EI_ABIVERSION , file version, always 1 apparently, might be different for cell? char pad[8] = { 0 }; // EI_PAD, padde d reserved bytes for future use short filetype = 2; // file type: 1 = relocatable, 2 = executable, 3 = shared object, 4 = core image short archtype = 20; // arch type, 20 == ppc 32 bit, or different for ppu? int fversion = 1; // file version, always 1, 0 = invalid int entry; // entry point, virtual address to which the system first transfers control, thu s starting the process int phdrpos; // progr am header table's file offset in bytes. If the file has no program header table, this member holds zero. int shdrpos; // secti on header table's file offset in bytes. If the file has no section header table, this member holds zero. int flags; // processor-specific flags associated with the file. Flag names take the form E F_machine_flag. (usually 0, what about ppu?) short hdrsize; // ELF h eader's size in bytes. short phdrent; // size in bytes of one entry in the file's program header table; all entries are the sa me size short phdrcnt; // numbe r of entries in the program header table short shdrent; // secti on header's size in bytes. A section header is one entry in the section header t able; short phdrcnt; // numbe r of entries in the section header table short strsec; // secti on header table index of the entry associated with the section name string table . If the file has no section name string table, this member holds the value SHN_ UNDEF // next follows an array of segments, one seg header is shown below int sh_name; // name of section, index into string table int type; // type description, loadable code or data, dyna mic linking info, etc. int flags; // 1 bit flags for various attributes int addr; // if section appears in memory, this is address to first byte, otherwise 0 int offset; // file byte offset from begining of file to fir st byte of section

int size; int link; int info; int entsize; entries)

// // // // section

section size in bytes section header table index link extra type dependent info specific table entry size (e.g. symbol table

// elf program header int type; // loadable code or data, dynamic linking info, etc. int offset; // file offset of segment int virtaddr; // virtual address to map segment int physaddr; // physical address, not used int filesize; // size of segment in file int memsize; // size of segment in memory (bigger if contains BSS) int flags; // Read, Write, Execute bits int align; // required alignment, invariably hardware page size

Вам также может понравиться