scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

elfphdr.h (1991B)


      1 /* See http://www.sco.com/developers/gabi/latest/contents.html */
      2 
      3 /* Segment types - p_type */
      4 #define PT_NULL         0               /* unused */
      5 #define PT_LOAD         1               /* loadable segment */
      6 #define PT_DYNAMIC      2               /* dynamic linking section */
      7 #define PT_INTERP       3               /* the RTLD */
      8 #define PT_NOTE         4               /* auxiliary information */
      9 #define PT_SHLIB        5               /* reserved - purpose undefined */
     10 #define PT_PHDR         6               /* program header */
     11 #define PT_TLS          7               /* thread local storage */
     12 #define PT_LOOS         0x60000000      /* reserved range for OS */
     13 #define PT_HIOS         0x6fffffff      /*  specific segment types */
     14 #define PT_LOPROC       0x70000000      /* reserved range for processor */
     15 #define PT_HIPROC       0x7fffffff      /*  specific segment types */
     16 
     17 #define ELFP32SZ        32
     18 #define ELFP64SZ        56
     19 
     20 typedef struct elf32_phdr Elf32_Phdr;
     21 typedef struct elf64_phdr Elf64_Phdr;
     22 
     23 /* Program Header */
     24 struct elf32_phdr {
     25 	Elf32_Word p_type;              /* segment type */
     26 	Elf32_Off p_offset;             /* segment offset */
     27 	Elf32_Addr p_vaddr;             /* virtual address of segment */
     28 	Elf32_Addr p_paddr;             /* physical address - ignored? */
     29 	Elf32_Word p_filesz;            /* number of bytes in file for seg. */
     30 	Elf32_Word p_memsz;             /* number of bytes in mem. for seg. */
     31 	Elf32_Word p_flags;             /* flags */
     32 	Elf32_Word p_align;             /* memory alignment */
     33 };
     34 
     35 struct elf64_phdr {
     36 	Elf64_Word p_type;              /* entry type */
     37 	Elf64_Word p_flags;             /* flags */
     38 	Elf64_Off p_offset;             /* offset */
     39 	Elf64_Addr p_vaddr;             /* virtual address */
     40 	Elf64_Addr p_paddr;             /* physical address */
     41 	Elf64_Xword p_filesz;           /* file size */
     42 	Elf64_Xword p_memsz;            /* memory size */
     43 	Elf64_Xword p_align;            /* memory & file alignment */
     44 };