scc

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

elfshdr.h (4290B)


      1 /* See http://www.sco.com/developers/gabi/latest/contents.html */
      2 
      3 /* Special Section Indexes */
      4 #define SHN_UNDEF	0		/* undefined */
      5 #define SHN_LORESERVE	0xff00		/* lower bounds of reserved indexes */
      6 #define SHN_LOPROC	0xff00		/* reserved range for processor */
      7 #define SHN_HIPROC	0xff1f		/*   specific section indexes */
      8 #define SHN_ABS		0xfff1		/* absolute value */
      9 #define SHN_COMMON	0xfff2		/* common symbol */
     10 #define SHN_XINDEX	0xffff		/* Escape -- index stored elsewhere. */
     11 #define SHN_HIRESERVE	0xffff		/* upper bounds of reserved indexes */
     12 
     13 /* sh_type */
     14 #define SHT_NULL		0	/* inactive */
     15 #define SHT_PROGBITS		1	/* program defined information */
     16 #define SHT_SYMTAB		2	/* symbol table section */
     17 #define SHT_STRTAB		3	/* string table section */
     18 #define SHT_RELA		4	/* relocation section with addends*/
     19 #define SHT_HASH		5	/* symbol hash table section */
     20 #define SHT_DYNAMIC		6	/* dynamic section */
     21 #define SHT_NOTE		7	/* note section */
     22 #define SHT_NOBITS		8	/* no space section */
     23 #define SHT_REL			9	/* relation section without addends */
     24 #define SHT_SHLIB		10	/* reserved - purpose unknown */
     25 #define SHT_DYNSYM		11	/* dynamic symbol table section */
     26 #define SHT_NUM			12	/* number of section types */
     27 #define SHT_INIT_ARRAY		14	/* pointers to init functions */
     28 #define SHT_FINI_ARRAY		15	/* pointers to termination functions */
     29 #define SHT_PREINIT_ARRAY	16	/* ptrs to funcs called before init */
     30 #define SHT_GROUP		17	/* defines a section group */
     31 #define SHT_SYMTAB_SHNDX	18	/* Section indexes (see SHN_XINDEX). */
     32 #define SHT_LOOS	0x60000000	/* reserved range for OS specific */
     33 #define SHT_SUNW_dof	0x6ffffff4	/* used by dtrace */
     34 #define SHT_GNU_LIBLIST	0x6ffffff7	/* libraries to be prelinked */
     35 #define SHT_SUNW_move	0x6ffffffa	/* inf for partially init'ed symbols */
     36 #define SHT_SUNW_syminfo	0x6ffffffc	/* ad symbol information */
     37 #define SHT_GNU_VERDEF	0x6ffffffd      /* symbol versioning inf */
     38 #define SHT_GNU_VERNEED	0x6ffffffe      /* symbol versioning req */
     39 #define SHT_GNU_VERSYM	0x6fffffff      /* symbol versioning table */
     40 #define SHT_HIOS	0x6fffffff	/*  section header types */
     41 #define SHT_LOPROC	0x70000000	/* reserved range for processor */
     42 #define SHT_HIPROC	0x7fffffff	/*  specific section header types */
     43 #define SHT_LOUSER	0x80000000	/* reserved range for application */
     44 #define SHT_HIUSER	0xffffffff	/*  specific indexes */
     45 
     46 #define SHT_GNU_HASH	0x6ffffff6	/* GNU-style hash table section */
     47 
     48 /* Section Attribute Flags - sh_flags */
     49 #define SHF_WRITE		0x1	/* Writable */
     50 #define SHF_ALLOC		0x2	/* occupies memory */
     51 #define SHF_EXECINSTR		0x4	/* executable */
     52 #define SHF_MERGE		0x10	/* may be merged */
     53 #define SHF_STRINGS		0x20	/* contains strings */
     54 #define SHF_INFO_LINK		0x40	/* sh_info holds section index */
     55 #define SHF_LINK_ORDER		0x80	/* ordering requirements */
     56 #define SHF_OS_NONCONFORMING	0x100	/* OS-specific processing required */
     57 #define SHF_GROUP		0x200	/* member of section group */
     58 #define SHF_TLS			0x400	/* thread local storage */
     59 #define SHF_COMPRESSED		0x800	/* contains compressed data */
     60 #define SHF_MASKOS	0x0ff00000	/* OS-specific semantics */
     61 #define SHF_MASKPROC	0xf0000000	/* reserved bits for processor */
     62 					/*  specific section attributes */
     63 
     64 #define ELFS32SZ                40
     65 #define ELFS64SZ                64
     66 
     67 typedef struct elf32_shdr Elf32_Shdr;
     68 typedef struct elf64_shdr Elf64_Shdr;
     69 
     70 /* Section Header */
     71 struct elf32_shdr {
     72 	Elf32_Word	sh_name;	/* section name */
     73 	Elf32_Word	sh_type;	/* type */
     74 	Elf32_Word	sh_flags;	/* flags */
     75 	Elf32_Addr	sh_addr;	/* address */
     76 	Elf32_Off	sh_offset;	/* file offset */
     77 	Elf32_Word	sh_size;	/* section size */
     78 	Elf32_Word	sh_link;	/* section header table index link */
     79 	Elf32_Word	sh_info;	/* extra information */
     80 	Elf32_Word	sh_addralign;	/* address alignment */
     81 	Elf32_Word	sh_entsize;	/* section entry size */
     82 };
     83 
     84 struct elf64_shdr {
     85 	Elf64_Word	sh_name;	/* section name */
     86 	Elf64_Word	sh_type;	/* section type */
     87 	Elf64_Xword	sh_flags;	/* section flags */
     88 	Elf64_Addr	sh_addr;	/* virtual address */
     89 	Elf64_Off	sh_offset;	/* file offset */
     90 	Elf64_Xword	sh_size;	/* section size */
     91 	Elf64_Word	sh_link;	/* link to another */
     92 	Elf64_Word	sh_info;	/* misc info */
     93 	Elf64_Xword	sh_addralign;	/* memory alignment */
     94 	Elf64_Xword	sh_entsize;	/* table entry size */
     95 };