1 /** 2 * D header file for FreeBSD. 3 * 4 * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/elf_common.h?view=markup, sys/elf_common.h) 5 */ 6 module core.sys.freebsd.sys.elf_common; 7 8 version (FreeBSD): 9 extern (C): 10 pure: 11 nothrow: 12 13 import core.stdc.stdint; 14 public import core.sys.elf; 15 16 struct Elf_Note 17 { 18 uint32_t n_namesz; 19 uint32_t n_descsz; 20 uint32_t n_type; 21 } 22 23 struct Elf_GNU_Hash_Header 24 { 25 uint32_t gh_nbuckets; 26 uint32_t gh_symndx; 27 uint32_t gh_maskwords; 28 uint32_t gh_shift2; 29 } 30 31 enum OLD_EI_BRAND = 8; 32 33 extern (D) 34 { 35 auto IS_ELF(T)(T ehdr) { return ehdr.e_ident[EI_MAG0] == ELFMAG0 && 36 ehdr.e_ident[EI_MAG1] == ELFMAG1 && 37 ehdr.e_ident[EI_MAG2] == ELFMAG2 && 38 ehdr.e_ident[EI_MAG3] == ELFMAG3; } 39 } 40 41 enum EM_486 = 6; 42 enum EM_MIPS_RS4_BE = 10; 43 enum EM_ALPHA_STD = 41; 44 enum SHT_SUNW_dof = 0x6ffffff4; 45 enum SHT_SUNW_cap = 0x6ffffff5; 46 enum SHT_SUNW_SIGNATURE = 0x6ffffff6; 47 enum SHT_SUNW_verdef = 0x6ffffffd; 48 enum SHT_SUNW_verneed = 0x6ffffffe; 49 enum SHT_SUNW_versym = 0x6fffffff; 50 51 enum PT_SUNWDTRACE = 0x6ffffffc; 52 enum PT_SUNWCAP = 0x6ffffffd; 53 54 enum DT_MAXPOSTAGS = 34; 55 enum DT_SUNW_AUXILIARY = 0x6000000d; 56 enum DT_SUNW_RTLDINF = 0x6000000e; 57 enum DT_SUNW_FILTER = 0x6000000f; 58 enum DT_SUNW_CAP = 0x60000010; 59 enum DT_DEPRECATED_SPARC_REGISTER = 0x7000001; 60 enum DT_USED = 0x7ffffffe; 61 62 enum DF_1_BIND_NOW = 0x00000001; 63 64 enum NT_PRSTATUS = 1; 65 enum NT_FPREGSET = 2; 66 enum NT_PRPSINFO = 3; 67 enum NT_THRMISC = 7; 68 enum NT_PROCSTAT_PROC = 8; 69 enum NT_PROCSTAT_FILES = 9; 70 enum NT_PROCSTAT_VMMAP = 10; 71 enum NT_PROCSTAT_GROUPS = 11; 72 enum NT_PROCSTAT_UMASK = 12; 73 enum NT_PROCSTAT_RLIMIT = 13; 74 enum NT_PROCSTAT_OSREL = 14; 75 enum NT_PROCSTAT_PSSTRINGS = 15; 76 enum NT_PROCSTAT_AUXV = 16; 77 78 enum STV_EXPORTED = 4; 79 enum STV_SINGLETON = 5; 80 enum STV_ELIMINATE = 6; 81 82 alias VER_NDX VER_DEF_IDX; 83 84 enum VER_NEED_WEAK = 32768; 85 enum VER_NEED_HIDDEN = VER_NDX_HIDDEN; 86 alias VER_NDX VER_NEED_IDX; 87 88 enum VER_NDX_GIVEN = 2; 89 enum VER_NDX_HIDDEN = 32768; 90 91 extern (D) 92 { 93 auto VER_NDX(V)(V v) { return v & ~(1u << 15); } 94 } 95 96 enum CA_SUNW_NULL = 0; 97 enum CA_SUNW_HW_1 = 1; 98 enum CA_SUNW_SF_1 = 2; 99 100 enum SYMINFO_FLG_DIRECTBIND = 0x0010; 101 enum SYMINFO_FLG_NOEXTDIRECT = 0x0020; 102 enum SYMINFO_FLG_FILTER = 0x0002; 103 enum SYMINFO_FLG_AUXILIARY = 0x0040; 104 105 enum SYMINFO_BT_NONE = 0xfffd; 106 enum SYMINFO_BT_EXTERN = 0xfffc; 107 108 version (PPC64) 109 { 110 enum __ELF_WORD_SIZE = 64; 111 enum ELF_ARCH = EM_PPC64; 112 enum ELF_MACHINE_OK(x) = ((x) == EM_PPC64); 113 } 114 version (PPC) 115 { 116 enum __ELF_WORD_SIZE = 32; 117 enum ELF_ARCH = EM_PPC; 118 enum ELF_ARCH32 = EM_PPC; 119 enum ELF_MACHINE_OK(x) = ((x) == EM_PPC); 120 } 121 122 struct Elf32_Auxinfo 123 { 124 int a_type; 125 union a_un 126 { 127 long a_val; 128 void *a_ptr; 129 void function(void* a) a_fcn; 130 } 131 } 132 133 struct Elf64_Auxinfo 134 { 135 long a_type; 136 union a_un 137 { 138 long a_val; 139 void *a_ptr; 140 void function(void* a) a_fcn; 141 } 142 } 143 144 enum AT_NULL = 0; 145 enum AT_IGNORE = 1; 146 enum AT_EXECFD = 2; 147 enum AT_PHDR = 3; 148 enum AT_PHENT = 4; 149 enum AT_PHNUM = 5; 150 enum AT_PAGESZ = 6; 151 enum AT_BASE = 7; 152 enum AT_FLAGS = 8; 153 enum AT_ENTRY = 9; 154 enum AT_DCACHEBSIZE = 10; 155 enum AT_ICACHEBSIZE = 11; 156 enum AT_UCACHEBSIZE = 12; 157 enum AT_EXECPATH = 13; 158 enum AT_CANARY = 14; 159 enum AT_CANARYLEN = 15; 160 enum AT_OSRELDATE = 16; 161 enum AT_NCPUS = 17; 162 enum AT_PAGESIZES = 18; 163 enum AT_PAGESIZESLEN = 19; 164 enum AT_STACKPROT = 21; 165 enum AT_TIMEKEEP = 22; 166 enum AT_COUNT = 23; 167 168 enum R_PPC_COUNT = 37; 169 enum R_PPC_EMB_COUNT = (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1); 170 171 version (PPC64) 172 { 173 enum ELF_TARG_CLASS = ELFCLASS64; 174 enum ELF_TARG_DATA = ELFDATA2MSB; 175 enum ELF_TARG_MACH = EM_PPC64; 176 enum ELF_TARG_VER = 1; 177 } 178 179 version (PPC) 180 { 181 enum ELF_TARG_CLASS = ELFCLASS32; 182 enum ELF_TARG_DATA = ELFDATA2MSB; 183 enum ELF_TARG_MACH = EM_PPC; 184 enum ELF_TARG_VER = 1; 185 } 186 187 enum ET_DYN_LOAD_ADDR = 0x01010000;