elf - #ifndef _ELF_H_ #define _ELF_H_ /* * Simplified ELF...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef _ELF_H_ #define _ELF_H_ /* * Simplified ELF definitions for OS/161 and System/161. * * Restrictions: * 32-bit only * No support for .o files or linker structures * Does not define all the random symbols a standard elf header would. */ /* * ELF file header. This appears at the very beginning of an ELF file. */ #define ELF_NIDENT 16 typedef struct { unsigned char e_ident[ELF_NIDENT]; /* magic number et al. */ u_int16_t e_type; /* type of file this is */ u_int16_t e_machine; /* processor type file is for */ u_int32_t e_version; /* ELF version */ u_int32_t e_entry; /* address of program entry point */ u_int32_t e_phoff; /* location in file of phdrs */ u_int32_t e_shoff; /* ignore */ u_int32_t e_flags; /* ignore */ u_int16_t e_ehsize; /* actual size of file header */ u_int16_t e_phentsize; /* actual size of phdr */ u_int16_t e_phnum; /* number of phdrs */ u_int16_t e_shentsize; /* ignore */ u_int16_t e_shnum; /* ignore */ u_int16_t e_shstrndx; /* ignore */ } Elf32_Ehdr; /* Offsets for the 1-byte fields within e_ident[] */ #define EI_MAG0 0 /* '\177' */ #define EI_MAG1 1 /* 'E' */ #define EI_MAG2 2 /* 'L' */ #define EI_MAG3 3 /* 'F' */ #define EI_CLASS 4 /* File class - always ELFCLASS32 */ #define EI_DATA 5 /* Data encoding - ELFDATA2LSB or ELFDATA2MSB*/ #define EI_VERSION 6 /* ELF version - EV_CURRENT*/
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

elf - #ifndef _ELF_H_ #define _ELF_H_ /* * Simplified ELF...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online