32#ifndef _SYS_EXEC_ELF_H_
33#define _SYS_EXEC_ELF_H_
43#if defined(_KERNEL) || defined(_STANDALONE)
51#define CONCAT(x,y) __CONCAT(x,y)
52#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
53#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
54#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE))
55#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
58#if HAVE_NBTOOL_CONFIG_H
59#include <nbinclude/machine/elf_machdep.h>
61#include <machine/elf_machdep.h>
64typedef uint8_t Elf_Byte;
66typedef uint32_t Elf32_Addr;
67#define ELF32_FSZ_ADDR 4
68typedef uint32_t Elf32_Off;
69typedef int32_t Elf32_SOff;
70#define ELF32_FSZ_OFF 4
71typedef int32_t Elf32_Sword;
72#define ELF32_FSZ_SWORD 4
73typedef uint32_t Elf32_Word;
74#define ELF32_FSZ_WORD 4
75typedef uint16_t Elf32_Half;
76#define ELF32_FSZ_HALF 2
77typedef uint64_t Elf32_Lword;
78#define ELF32_FSZ_LWORD 8
80typedef uint64_t Elf64_Addr;
81#define ELF64_FSZ_ADDR 8
82typedef uint64_t Elf64_Off;
83typedef int64_t Elf64_SOff;
84#define ELF64_FSZ_OFF 8
86typedef int32_t Elf64_Sword;
87#define ELF64_FSZ_SWORD 4
88typedef uint32_t Elf64_Word;
89#define ELF64_FSZ_WORD 4
91typedef int64_t Elf64_Sxword;
92#define ELF64_FSZ_SXWORD 8
93typedef uint64_t Elf64_Xword;
94#define ELF64_FSZ_XWORD 8
95typedef uint64_t Elf64_Lword;
96#define ELF64_FSZ_LWORD 8
97typedef uint16_t Elf64_Half;
98#define ELF64_FSZ_HALF 2
106 unsigned char e_ident[ELF_NIDENT];
108 Elf32_Half e_machine;
109 Elf32_Word e_version;
115 Elf32_Half e_phentsize;
117 Elf32_Half e_shentsize;
119 Elf32_Half e_shstrndx;
123 unsigned char e_ident[ELF_NIDENT];
125 Elf64_Half e_machine;
126 Elf64_Word e_version;
132 Elf64_Half e_phentsize;
134 Elf64_Half e_shentsize;
136 Elf64_Half e_shstrndx;
148#define EI_ABIVERSION 8
157#define ELFMAG "\177ELF"
161#define ELFCLASSNONE 0
177#define ELFOSABI_SYSV 0
178#define ELFOSABI_HPUX 1
179#define ELFOSABI_NETBSD 2
180#define ELFOSABI_GNU 3
181#define ELFOSABI_HURD 4
182#define ELFOSABI_86OPEN 5
183#define ELFOSABI_SOLARIS 6
184#define ELFOSABI_AIX 7
185#define ELFOSABI_IRIX 8
186#define ELFOSABI_FREEBSD 9
187#define ELFOSABI_TRU64 10
188#define ELFOSABI_MODESTO 11
189#define ELFOSABI_OPENBSD 12
190#define ELFOSABI_OPENVMS 13
191#define ELFOSABI_NSK 14
192#define ELFOSABI_AROS 15
193#define ELFOSABI_FENIXOS 16
194#define ELFOSABI_CLOUDABI 17
195#define ELFOSABI_OPENVOS 18
197#define ELFOSABI_ARM 97
198#define ELFOSABI_STANDALONE 255
200#define ELFOSABI_NONE ELFOSABI_SYSV
203#define ELFOSABI_LINUX ELFOSABI_GNU
204#define ELFOSABI_MONTEREY ELFOSABI_AIX
214#define ET_LOOS 0xfe00
215#define ET_HIOS 0xfeff
216#define ET_LOPROC 0xff00
217#define ET_HIPROC 0xffff
231#define EM_MIPS_RS3_LE 10
237#define EM_SPARC32PLUS 18
249#define EM_OLD_ALPHA 41
260#define EM_COLDFIRE 52
266#define EM_STARCORE 58
286#define EM_FIREPATH 78
301#define EM_OPENRISC EM_OR1K
304#define EM_VIDEOCORE 95
315#define EM_BLACKFIN 106
319#define EM_UNICORE 110
322#define EM_ALTERA_NIOS2 113
327#define EM_DSPIC30F 118
331#define EM_TSK3000 131
337#define EM_VIDEOCORE3 137
338#define EM_LATTICEMICO32 138
340#define EM_TI_C6000 140
341#define EM_TI_C2000 141
342#define EM_TI_C5500 142
343#define EM_TI_ARP32 143
346#define EM_MMDSP_PLUS 160
347#define EM_CYPRESS_M8C 161
349#define EM_TRIMEDIA 163
359#define EM_CRAYNV2 172
362#define EM_MCST_ELBRUS 175
370#define EM_AARCH64 183
374#define EM_TILEPRO 188
375#define EM_MICROBLAZE 189
378#define EM_CLOUDSHIELD 192
379#define EM_COREA_1ST 193
380#define EM_COREA_2ND 194
381#define EM_ARC_COMPACT2 195
384#define EM_VIDEOCORE5 198
386#define EM_56800EX 200
390#define EM_MCHP_PIC 204
391#define EM_INTEL205 205
392#define EM_INTEL206 206
393#define EM_INTEL207 207
394#define EM_INTEL208 208
395#define EM_INTEL209 209
405#define EM_CSR_KALIMBA 219
416#define EM_ALPHA_EXP 36902
439 Elf64_Xword p_filesz;
455#define PT_LOOS 0x60000000
458#define PT_GNU_EH_FRAME 0x6474e550
459#define PT_GNU_STACK 0x6474e551
460#define PT_GNU_RELRO 0x6474e552
462#define PT_HIOS 0x6fffffff
463#define PT_LOPROC 0x70000000
464#define PT_HIPROC 0x7fffffff
466#define PT_MIPS_REGINFO 0x70000000
467#define PT_MIPS_ABIFLAGS 0x70000003
474#define PF_MASKOS 0x0ff00000
475#define PF_MASKPROC 0xf0000000
478#define PN_XNUM 0xffff
492 Elf32_Word sh_addralign;
493 Elf32_Word sh_entsize;
499 Elf64_Xword sh_flags;
505 Elf64_Xword sh_addralign;
506 Elf64_Xword sh_entsize;
511#define SHT_PROGBITS 1
522#define SHT_INIT_ARRAY 14
523#define SHT_FINI_ARRAY 15
524#define SHT_PREINIT_ARRAY 16
526#define SHT_SYMTAB_SHNDX 18
529#define SHT_LOOS 0x60000000
530#define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700
531#define SHT_LOSUNW 0x6ffffff4
532#define SHT_SUNW_dof 0x6ffffff4
533#define SHT_GNU_ATTRIBUTES 0x6ffffff5
534#define SHT_SUNW_cap 0x6ffffff5
535#define SHT_SUNW_SIGNATURE 0x6ffffff6
536#define SHT_GNU_HASH 0x6ffffff6
537#define SHT_GNU_LIBLIST 0x6ffffff7
538#define SHT_SUNW_move 0x6ffffffa
539#define SHT_SUNW_COMDAT 0x6ffffffb
540#define SHT_SUNW_syminfo 0x6ffffffc
541#define SHT_SUNW_verdef 0x6ffffffd
542#define SHT_GNU_verdef SHT_SUNW_verdef
543#define SHT_SUNW_verneed 0x6ffffffe
544#define SHT_GNU_verneed SHT_SUNW_verneed
545#define SHT_SUNW_versym 0x6fffffff
546#define SHT_GNU_versym SHT_SUNW_versym
547#define SHT_HISUNW 0x6fffffff
548#define SHT_HIOS 0x6fffffff
549#define SHT_LOPROC 0x70000000
550#define SHT_AMD64_UNWIND 0x70000001
551#define SHT_ARM_EXIDX 0x70000001
552#define SHT_ARM_PREEMPTMAP 0x70000002
554#define SHT_ARM_ATTRIBUTES 0x70000003
556#define SHT_ARM_DEBUGOVERLAY 0x70000004
557#define SHT_ARM_OVERLAYSECTION 0x70000005
558#define SHT_MIPS_REGINFO 0x70000006
559#define SHT_MIPS_OPTIONS 0x7000000d
560#define SHT_MIPS_DWARF 0x7000001e
561#define SHT_MIPS_XHASH 0x7000002b
562#define SHT_HIPROC 0x7fffffff
563#define SHT_LOUSER 0x80000000
564#define SHT_HIUSER 0xffffffff
567#define SHF_WRITE 0x00000001
568#define SHF_ALLOC 0x00000002
569#define SHF_EXECINSTR 0x00000004
570#define SHF_MERGE 0x00000010
571#define SHF_STRINGS 0x00000020
572#define SHF_INFO_LINK 0x00000040
573#define SHF_LINK_ORDER 0x00000080
574#define SHF_OS_NONCONFORMING 0x00000100
575#define SHF_GROUP 0x00000200
576#define SHF_TLS 0x00000400
577#define SHF_MASKOS 0x0ff00000
578#define SHF_MASKPROC 0xf0000000
579#define SHF_ORDERED 0x40000000
580#define SHF_EXCLUDE 0x80000000
604#define ELF_SYM_UNDEFINED 0
630#define STT_GNU_IFUNC 10
637#define STV_INTERNAL 1
639#define STV_PROTECTED 3
640#define STV_EXPORTED 4
641#define STV_SINGLETON 5
642#define STV_ELIMINATE 6
645#define ELF_ST_BIND(info) ((uint32_t)(info) >> 4)
646#define ELF_ST_TYPE(info) ((uint32_t)(info) & 0xf)
647#define ELF_ST_INFO(bind,type) ((Elf_Byte)(((bind) << 4) | \
649#define ELF_ST_VISIBILITY(other) ((uint32_t)(other) & 3)
656#define SHN_LORESERVE 0xff00
657#define SHN_ABS 0xfff1
658#define SHN_COMMON 0xfff2
659#define SHN_XINDEX 0xffff
660#define SHN_HIRESERVE 0xffff
662#define SHN_LOPROC 0xff00
663#define SHN_HIPROC 0xff1f
664#define SHN_LOOS 0xff20
665#define SHN_HIOS 0xff3f
667#define SHN_MIPS_ACOMMON 0xff00
668#define SHN_MIPS_TEXT 0xff01
669#define SHN_MIPS_DATA 0xff02
670#define SHN_MIPS_SCOMMON 0xff03
683 Elf32_Sword r_addend;
687#define ELF32_R_SYM(info) ((info) >> 8)
688#define ELF32_R_TYPE(info) ((info) & 0xff)
689#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type))
699 Elf64_Sxword r_addend;
703#define ELF64_R_SYM(info) ((info) >> 32)
704#define ELF64_R_TYPE(info) ((info) & 0xffffffff)
705#define ELF64_R_INFO(sym,type) (((sym) << 32) + (type))
713 Elf32_Word m_poffset;
718#define ELF32_M_SYM(info) ((info) >> 8)
719#define ELF32_M_SIZE(info) (info) & 0xff)
720#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size))
725 Elf64_Xword m_poffset;
730#define ELF64_M_SYM(info) ((info) >> 8)
731#define ELF64_M_SIZE(info) (info) & 0xff)
732#define ELF64_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size))
789#define DT_SYMBOLIC 16
797#define DT_BIND_NOW 24
798#define DT_INIT_ARRAY 25
799#define DT_FINI_ARRAY 26
800#define DT_INIT_ARRAYSZ 27
801#define DT_FINI_ARRAYSZ 28
804#define DT_ENCODING 31
805#define DT_PREINIT_ARRAY 32
806#define DT_PREINIT_ARRAYSZ 33
809#define DT_LOOS 0x60000000
810#define DT_GNU_HASH 0x6ffffef5
811#define DT_VERSYM 0x6ffffff0
812#define DT_FLAGS_1 0x6ffffffb
813#define DT_VERDEF 0x6ffffffc
814#define DT_VERDEFNUM 0x6ffffffd
815#define DT_VERNEED 0x6ffffffe
816#define DT_VERNEEDNUM 0x6fffffff
817#define DT_HIOS 0x6fffffff
818#define DT_LOPROC 0x70000000
819#define DT_MIPS_XHASH 0x70000036
820#define DT_HIPROC 0x7fffffff
823#define DF_ORIGIN 0x00000001
824#define DF_SYMBOLIC 0x00000002
825#define DF_TEXTREL 0x00000004
826#define DF_BIND_NOW 0x00000008
827#define DF_STATIC_TLS 0x00000010
830#define DF_1_NOW 0x00000001
831#define DF_1_GLOBAL 0x00000002
832#define DF_1_GROUP 0x00000004
833#define DF_1_NODELETE 0x00000008
834#define DF_1_LOADFLTR 0x00000010
835#define DF_1_INITFIRST 0x00000020
836#define DF_1_NOOPEN 0x00000040
837#define DF_1_ORIGIN 0x00000080
838#define DF_1_DIRECT 0x00000100
839#define DF_1_INTERPOSE 0x00000400
840#define DF_1_NODEFLIB 0x00000800
841#define DF_1_NODUMP 0x00001000
842#define DF_1_CONFALT 0x00002000
843#define DF_1_ENDFILTEE 0x00004000
844#define DF_1_DISPRELDNE 0x00008000
845#define DF_1_DISPRELPND 0x00010000
846#define DF_1_NODIRECT 0x00020000
847#define DF_1_IGNMULDEF 0x00040000
848#define DF_1_NOKSYMS 0x00080000
849#define DF_1_NOHDR 0x00100000
850#define DF_1_EDITED 0x00200000
851#define DF_1_NORELOC 0x00400000
852#define DF_1_SYMINTPOSE 0x00800000
853#define DF_1_GLOBAUDIT 0x01000000
854#define DF_1_SINGLETON 0x02000000
855#define DF_1_STUB 0x04000000
856#define DF_1_PIE 0x08000000
882#define AT_DCACHEBSIZE 10
883#define AT_ICACHEBSIZE 11
884#define AT_UCACHEBSIZE 12
885#define AT_STACKBASE 13
888#define AT_MIPS_NOTELF 10
896#define AT_SUN_LDELF 2004
897#define AT_SUN_LDSHDR 2005
898#define AT_SUN_LDNAME 2006
899#define AT_SUN_LPGSIZE 2007
902#define AT_SUN_PLATFORM 2008
903#define AT_SUN_HWCAP 2009
904#define AT_SUN_IFLUSH 2010
905#define AT_SUN_CPU 2011
907#define AT_SUN_EMUL_ENTRY 2012
908#define AT_SUN_EMUL_EXECFD 2013
910#define AT_SUN_EXECNAME 2014
916 uint32_t gh_nbuckets;
918 uint32_t gh_maskwords;
937#define ELF_NOTE_GNU_NAMESZ 4
938#define ELF_NOTE_GNU_NAME "GNU\0"
952#define ELF_NOTE_TYPE_ABI_TAG 1
953#define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME
954#define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ
955#define ELF_NOTE_ABI_DESCSZ 16
957#define ELF_NOTE_ABI_OS_LINUX 0
958#define ELF_NOTE_ABI_OS_HURD 1
959#define ELF_NOTE_ABI_OS_SOLARIS 2
960#define ELF_NOTE_ABI_OS_KFREEBSD 3
961#define ELF_NOTE_ABI_OS_KNETBSD 4
964#define ELF_NOTE_OGCC_NAMESZ 8
965#define ELF_NOTE_OGCC_NAME "01.01\0\0\0\0"
966#define ELF_NOTE_OGCC_DESCSZ 0
978#define ELF_NOTE_TYPE_GNU_HWCAP 2
989#define ELF_NOTE_TYPE_GNU_BUILD_ID 3
1001#define ELF_NOTE_TYPE_SUSE_TAG 1
1003#define ELF_NOTE_SUSE_NAMESZ 5
1004#define ELF_NOTE_SUSE_DESCSZ 2
1006#define ELF_NOTE_SUSE_NAME "SuSE\0"
1020#define ELF_NOTE_TYPE_SUSE_VERSION_TAG 0x45537553
1022#define ELF_NOTE_SUSE_VERSION_NAMESZ 8
1023#define ELF_NOTE_SUSE_VERSION_DESCSZ 8
1025#define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0"
1034#define ELF_NOTE_TYPE_GO_BUILDID_TAG 4
1035#define ELF_NOTE_GO_BUILDID_NAMESZ 4
1036#define ELF_NOTE_GO_BUILDID_DESCSZ 40
1037#define ELF_NOTE_GO_BUILDID_NAME "Go\0\0"
1051#define ELF_NOTE_TYPE_NETBSD_TAG 1
1053#define ELF_NOTE_NETBSD_NAMESZ 7
1054#define ELF_NOTE_NETBSD_DESCSZ 4
1056#define ELF_NOTE_NETBSD_NAME "NetBSD\0\0"
1066#define ELF_NOTE_TYPE_NETBSD_EMUL_TAG 2
1067#define ELF_NOTE_NETBSD_EMUL_NAMESZ 7
1068#define ELF_NOTE_NETBSD_EMUL_DESCSZ 7
1070#define ELF_NOTE_NETBSD_EMUL_NAME "NetBSD\0\0"
1081#define ELF_NOTE_TYPE_PAX_TAG 3
1082#define ELF_NOTE_PAX_MPROTECT 0x01
1083#define ELF_NOTE_PAX_NOMPROTECT 0x02
1084#define ELF_NOTE_PAX_GUARD 0x04
1085#define ELF_NOTE_PAX_NOGUARD 0x08
1086#define ELF_NOTE_PAX_ASLR 0x10
1087#define ELF_NOTE_PAX_NOASLR 0x20
1088#define ELF_NOTE_PAX_NAMESZ 4
1089#define ELF_NOTE_PAX_NAME "PaX\0"
1090#define ELF_NOTE_PAX_DESCSZ 4
1117#define ELF_NOTE_NETBSD_CORE_NAME "NetBSD-CORE"
1119#define ELF_NOTE_NETBSD_CORE_PROCINFO 1
1120#define ELF_NOTE_NETBSD_CORE_AUXV 2
1122#define NETBSD_ELFCORE_PROCINFO_VERSION 1
1126 uint32_t cpi_version;
1127 uint32_t cpi_cpisize;
1129 uint32_t cpi_sigcode;
1130 uint32_t cpi_sigpend[4];
1131 uint32_t cpi_sigmask[4];
1132 uint32_t cpi_sigignore[4];
1133 uint32_t cpi_sigcatch[4];
1145 int8_t cpi_name[32];
1158#define ELF_NOTE_TYPE_MARCH_TAG 5
1160#define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ
1162#define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME
1172#define ELF_NOTE_TYPE_MCMODEL_TAG 6
1174#define ELF_NOTE_MCMODEL_NAMESZ ELF_NOTE_NETBSD_NAMESZ
1176#define ELF_NOTE_MCMODEL_NAME ELF_NOTE_NETBSD_NAME
1179#if !defined(ELFSIZE)
1180# if defined(_RUMPKERNEL) || !defined(_KERNEL)
1181# define ELFSIZE ARCH_ELFSIZE
1183# define ELFSIZE KERN_ELFSIZE
1188#define CONCAT(x,y) __CONCAT(x,y)
1189#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
1190#define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
1191#define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE))
1192#define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
1193#define ElfW(x) CONCAT(Elf,CONCAT(ELFSIZE,CONCAT(_,x)))
1196#if defined(ELFSIZE) && (ELFSIZE == 32)
1197#define Elf_Ehdr Elf32_Ehdr
1198#define Elf_Phdr Elf32_Phdr
1199#define Elf_Shdr Elf32_Shdr
1200#define Elf_Sym Elf32_Sym
1201#define Elf_Rel Elf32_Rel
1202#define Elf_Rela Elf32_Rela
1203#define Elf_Dyn Elf32_Dyn
1204#define Elf_Word Elf32_Word
1205#define Elf_Sword Elf32_Sword
1206#define Elf_Half Elf32_Half
1207#define Elf_Addr Elf32_Addr
1208#define Elf_Off Elf32_Off
1209#define Elf_SOff Elf32_SOff
1210#define Elf_Nhdr Elf32_Nhdr
1211#define Elf_Verdef Elf32_Verdef
1212#define Elf_Verdaux Elf32_Verdaux
1213#define Elf_Verneed Elf32_Verneed
1214#define Elf_Vernaux Elf32_Vernaux
1215#define Elf_Versym Elf32_Versym
1217#define ELF_R_SYM ELF32_R_SYM
1218#define ELF_R_TYPE ELF32_R_TYPE
1219#define ELFCLASS ELFCLASS32
1221#define AuxInfo Aux32Info
1222#elif defined(ELFSIZE) && (ELFSIZE == 64)
1223#define Elf_Ehdr Elf64_Ehdr
1224#define Elf_Phdr Elf64_Phdr
1225#define Elf_Shdr Elf64_Shdr
1226#define Elf_Sym Elf64_Sym
1227#define Elf_Rel Elf64_Rel
1228#define Elf_Rela Elf64_Rela
1229#define Elf_Dyn Elf64_Dyn
1230#define Elf_Word Elf64_Word
1231#define Elf_Sword Elf64_Sword
1232#define Elf_Half Elf64_Half
1233#define Elf_Addr Elf64_Addr
1234#define Elf_Off Elf64_Off
1235#define Elf_SOff Elf64_SOff
1236#define Elf_Nhdr Elf64_Nhdr
1237#define Elf_Verdef Elf64_Verdef
1238#define Elf_Verdaux Elf64_Verdaux
1239#define Elf_Verneed Elf64_Verneed
1240#define Elf_Vernaux Elf64_Vernaux
1241#define Elf_Versym Elf64_Versym
1243#define ELF_R_SYM ELF64_R_SYM
1244#define ELF_R_TYPE ELF64_R_TYPE
1245#define ELFCLASS ELFCLASS64
1247#define AuxInfo Aux64Info
1251#define Elf_Symindx uint32_t
1254#define ELF32_ST_BIND(info) ELF_ST_BIND(info)
1255#define ELF32_ST_TYPE(info) ELF_ST_TYPE(info)
1256#define ELF32_ST_INFO(bind,type) ELF_ST_INFO(bind,type)
1257#define ELF32_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other)
1259#define ELF64_ST_BIND(info) ELF_ST_BIND(info)
1260#define ELF64_ST_TYPE(info) ELF_ST_TYPE(info)
1261#define ELF64_ST_INFO(bind,type) ELF_ST_INFO(bind,type)
1262#define ELF64_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other)
1265 Elf32_Half si_boundto;
1266 Elf32_Half si_flags;
1270 Elf64_Word si_boundto;
1271 Elf64_Word si_flags;
1274#define SYMINFO_FLG_DIRECT 0x0001
1276#define SYMINFO_FLG_PASSTHRU 0x0002
1277#define SYMINFO_FLG_COPY 0x0004
1278#define SYMINFO_FLG_LAZYLOAD 0x0008
1280#define SYMINFO_FLG_DIRECTBIND 0x0010
1282#define SYMINFO_FLG_NOEXTDIRECT 0x0020
1284#define SYMINFO_FLG_FILTER 0x0002
1285#define SYMINFO_FLG_AUXILIARY 0x0040
1287#define SYMINFO_BT_SELF 0xffff
1288#define SYMINFO_BT_PARENT 0xfffe
1289#define SYMINFO_BT_NONE 0xfffd
1290#define SYMINFO_BT_EXTERN 0xfffc
1291#define SYMINFO_BT_LOWRESERVE 0xff00
1293#define SYMINFO_NONE 0
1294#define SYMINFO_CURRENT 1
1295#define SYMINFO_NUM 2
1300#define VER_DEF_NONE 0
1301#define VER_DEF_CURRENT 1
1306#define VER_DEF_IDX(x) VER_NDX(x)
1311#define VER_FLG_BASE 0x1
1312#define VER_FLG_WEAK 0x2
1317#define VER_NDX_LOCAL 0
1318#define VER_NDX_GLOBAL 1
1319#define VER_NDX_GIVEN 2
1324#define VER_NEED_NONE 0
1325#define VER_NEED_CURRENT 1
1330#define VER_NEED_HIDDEN VER_NDX_HIDDEN
1331#define VER_NEED_IDX(x) VER_NDX(x)
1334#define VER_NDX_HIDDEN 0x8000
1335#define VER_NDX(x) ((x) & ~VER_NDX_HIDDEN)
1340#define VERSYM_HIDDEN 0x8000
1341#define VERSYM_VERSION 0x7fff
1343#define ELF_VER_CHR '@'
1350 Elf32_Half vd_version;
1351 Elf32_Half vd_flags;
1361 Elf32_Word vda_name;
1362 Elf32_Word vda_next;
1367 Elf32_Half vn_version;
1376 Elf32_Word vna_hash;
1377 Elf32_Half vna_flags;
1378 Elf32_Half vna_other;
1379 Elf32_Word vna_name;
1380 Elf32_Word vna_next;
1394#define ELF_MAXPHNUM 128
1395#define ELF_MAXSHNUM 32768
1396#define ELF_MAXNOTESIZE 1024
1398#define ELF_AUX_ENTRIES 15
1399#define ELF32_NO_ADDR (~(Elf32_Addr)0)
1400#define ELF32_LINK_ADDR ((Elf32_Addr)-2)
1401#define ELF64_NO_ADDR (~(Elf64_Addr)0)
1402#define ELF64_LINK_ADDR ((Elf64_Addr)-2)
1404#if defined(ELFSIZE) && (ELFSIZE == 64)
1405#define ELF_NO_ADDR ELF64_NO_ADDR
1406#define ELF_LINK_ADDR ELF64_LINK_ADDR
1407#elif defined(ELFSIZE) && (ELFSIZE == 32)
1408#define ELF_NO_ADDR ELF32_NO_ADDR
1409#define ELF_LINK_ADDR ELF32_LINK_ADDR
1412#ifndef ELF32_EHDR_FLAGS_OK
1413#define ELF32_EHDR_FLAGS_OK(eh) 1
1416#ifndef ELF64_EHDR_FLAGS_OK
1417#define ELF64_EHDR_FLAGS_OK(eh) 1
1420#if defined(ELFSIZE) && (ELFSIZE == 64)
1421#define ELF_EHDR_FLAGS_OK(eh) ELF64_EHDR_FLAGS_OK(eh)
1423#define ELF_EHDR_FLAGS_OK(eh) ELF32_EHDR_FLAGS_OK(eh)
1429 Elf_Addr arg_interp;
1430 Elf_Addr arg_phaddr;
1431 Elf_Addr arg_phentsize;
1437#include "opt_execfmt.h"
1441struct coredump_iostate;
1446int exec_elf32_makecmds(
struct lwp *,
struct exec_package *);
1447int elf32_populate_auxv(
struct lwp *,
struct exec_package *,
char **);
1448int elf32_copyargs(
struct lwp *,
struct exec_package *,
1449 struct ps_strings *,
char **,
void *);
1454int real_coredump_elf32(
struct lwp *,
struct coredump_iostate *);
1455int coredump_elf32(
struct lwp *,
struct coredump_iostate *);
1456void coredump_savenote_elf32(
struct note_state *,
unsigned int,
1457 const char *,
void *,
size_t);
1461int exec_elf64_makecmds(
struct lwp *,
struct exec_package *);
1462int elf64_populate_auxv(
struct lwp *,
struct exec_package *,
char **);
1463int elf64_copyargs(
struct lwp *,
struct exec_package *,
1464 struct ps_strings *,
char **,
void *);
1469int real_coredump_elf64(
struct lwp *,
struct coredump_iostate *);
1470int coredump_elf64(
struct lwp *,
struct coredump_iostate *);
1471void coredump_savenote_elf64(
struct note_state *,
unsigned int,
1472 const char *,
void *,
size_t);
Provide printf() PRIxxx Constante Beyond Standards.
Definition: exec_elf.h:858
Definition: exec_elf.h:863
Definition: exec_elf.h:734
Definition: exec_elf.h:753
Definition: exec_elf.h:105
Definition: exec_elf.h:707
Definition: exec_elf.h:922
Definition: exec_elf.h:422
Definition: exec_elf.h:672
Definition: exec_elf.h:677
Definition: exec_elf.h:483
Definition: exec_elf.h:582
Definition: exec_elf.h:1261
Definition: exec_elf.h:1353
Definition: exec_elf.h:1342
Definition: exec_elf.h:1368
Definition: exec_elf.h:1359
Definition: exec_elf.h:1377
Definition: exec_elf.h:742
Definition: exec_elf.h:761
Definition: exec_elf.h:122
Definition: exec_elf.h:719
Definition: exec_elf.h:928
Definition: exec_elf.h:433
Definition: exec_elf.h:688
Definition: exec_elf.h:693
Definition: exec_elf.h:496
Definition: exec_elf.h:591
Definition: exec_elf.h:1266
Definition: exec_elf.h:1121