scc

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

elfphdr.h (2149B)


      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 PF_X            1               /* Execute */
     18 #define PF_W            2               /* Write */
     19 #define PF_R            4               /* Read */
     20 
     21 #define ELFP32SZ        32
     22 #define ELFP64SZ        56
     23 
     24 typedef struct elf32_phdr Elf32_Phdr;
     25 typedef struct elf64_phdr Elf64_Phdr;
     26 
     27 /* Program Header */
     28 struct elf32_phdr {
     29 	Elf32_Word p_type;              /* segment type */
     30 	Elf32_Off p_offset;             /* segment offset */
     31 	Elf32_Addr p_vaddr;             /* virtual address of segment */
     32 	Elf32_Addr p_paddr;             /* physical address - ignored? */
     33 	Elf32_Word p_filesz;            /* number of bytes in file for seg. */
     34 	Elf32_Word p_memsz;             /* number of bytes in mem. for seg. */
     35 	Elf32_Word p_flags;             /* flags */
     36 	Elf32_Word p_align;             /* memory alignment */
     37 };
     38 
     39 struct elf64_phdr {
     40 	Elf64_Word p_type;              /* entry type */
     41 	Elf64_Word p_flags;             /* flags */
     42 	Elf64_Off p_offset;             /* offset */
     43 	Elf64_Addr p_vaddr;             /* virtual address */
     44 	Elf64_Addr p_paddr;             /* physical address */
     45 	Elf64_Xword p_filesz;           /* file size */
     46 	Elf64_Xword p_memsz;            /* memory size */
     47 	Elf64_Xword p_align;            /* memory & file alignment */
     48 };