| @@ -1,1307 +1,1324 @@ | | | @@ -1,1307 +1,1324 @@ |
1 | /* $NetBSD: exec_elf.h,v 1.141 2014/07/08 17:16:25 maxv Exp $ */ | | 1 | /* $NetBSD: exec_elf.h,v 1.141.2.1 2015/11/08 00:57:09 riz Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1994 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1994 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Christos Zoulas. | | 8 | * by Christos Zoulas. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
15 | * 2. Redistributions in binary form must reproduce the above copyright | | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in the | | 16 | * notice, this list of conditions and the following disclaimer in the |
17 | * documentation and/or other materials provided with the distribution. | | 17 | * documentation and/or other materials provided with the distribution. |
18 | * | | 18 | * |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #ifndef _SYS_EXEC_ELF_H_ | | 32 | #ifndef _SYS_EXEC_ELF_H_ |
33 | #define _SYS_EXEC_ELF_H_ | | 33 | #define _SYS_EXEC_ELF_H_ |
34 | | | 34 | |
35 | /* | | 35 | /* |
36 | * The current ELF ABI specification is available at: | | 36 | * The current ELF ABI specification is available at: |
37 | * http://www.sco.com/developers/gabi/ | | 37 | * http://www.sco.com/developers/gabi/ |
38 | * | | 38 | * |
39 | * Current header definitions are in: | | 39 | * Current header definitions are in: |
40 | * http://www.sco.com/developers/gabi/latest/ch4.eheader.html | | 40 | * http://www.sco.com/developers/gabi/latest/ch4.eheader.html |
41 | */ | | 41 | */ |
42 | | | 42 | |
43 | #if defined(_KERNEL) || defined(_STANDALONE) | | 43 | #if defined(_KERNEL) || defined(_STANDALONE) |
44 | #include <sys/types.h> | | 44 | #include <sys/types.h> |
45 | #else | | 45 | #else |
46 | #include <inttypes.h> | | 46 | #include <inttypes.h> |
47 | #endif /* _KERNEL || _STANDALONE */ | | 47 | #endif /* _KERNEL || _STANDALONE */ |
48 | | | 48 | |
49 | #if HAVE_NBTOOL_CONFIG_H | | 49 | #if HAVE_NBTOOL_CONFIG_H |
50 | #include <nbinclude/machine/elf_machdep.h> | | 50 | #include <nbinclude/machine/elf_machdep.h> |
51 | #else | | 51 | #else |
52 | #include <machine/elf_machdep.h> | | 52 | #include <machine/elf_machdep.h> |
53 | #endif | | 53 | #endif |
54 | | | 54 | |
55 | typedef uint8_t Elf_Byte; | | 55 | typedef uint8_t Elf_Byte; |
56 | | | 56 | |
57 | typedef uint32_t Elf32_Addr; | | 57 | typedef uint32_t Elf32_Addr; |
58 | #define ELF32_FSZ_ADDR 4 | | 58 | #define ELF32_FSZ_ADDR 4 |
59 | typedef uint32_t Elf32_Off; | | 59 | typedef uint32_t Elf32_Off; |
60 | typedef int32_t Elf32_SOff; | | 60 | typedef int32_t Elf32_SOff; |
61 | #define ELF32_FSZ_OFF 4 | | 61 | #define ELF32_FSZ_OFF 4 |
62 | typedef int32_t Elf32_Sword; | | 62 | typedef int32_t Elf32_Sword; |
63 | #define ELF32_FSZ_SWORD 4 | | 63 | #define ELF32_FSZ_SWORD 4 |
64 | typedef uint32_t Elf32_Word; | | 64 | typedef uint32_t Elf32_Word; |
65 | #define ELF32_FSZ_WORD 4 | | 65 | #define ELF32_FSZ_WORD 4 |
66 | typedef uint16_t Elf32_Half; | | 66 | typedef uint16_t Elf32_Half; |
67 | #define ELF32_FSZ_HALF 2 | | 67 | #define ELF32_FSZ_HALF 2 |
68 | typedef uint64_t Elf32_Lword; | | 68 | typedef uint64_t Elf32_Lword; |
69 | #define ELF32_FSZ_LWORD 8 | | 69 | #define ELF32_FSZ_LWORD 8 |
70 | | | 70 | |
71 | typedef uint64_t Elf64_Addr; | | 71 | typedef uint64_t Elf64_Addr; |
72 | #define ELF64_FSZ_ADDR 8 | | 72 | #define ELF64_FSZ_ADDR 8 |
73 | typedef uint64_t Elf64_Off; | | 73 | typedef uint64_t Elf64_Off; |
74 | typedef int64_t Elf64_SOff; | | 74 | typedef int64_t Elf64_SOff; |
75 | #define ELF64_FSZ_OFF 8 | | 75 | #define ELF64_FSZ_OFF 8 |
76 | | | 76 | |
77 | typedef int32_t Elf64_Sword; | | 77 | typedef int32_t Elf64_Sword; |
78 | #define ELF64_FSZ_SWORD 4 | | 78 | #define ELF64_FSZ_SWORD 4 |
79 | typedef uint32_t Elf64_Word; | | 79 | typedef uint32_t Elf64_Word; |
80 | #define ELF64_FSZ_WORD 4 | | 80 | #define ELF64_FSZ_WORD 4 |
81 | | | 81 | |
82 | typedef int64_t Elf64_Sxword; | | 82 | typedef int64_t Elf64_Sxword; |
83 | #define ELF64_FSZ_SXWORD 8 | | 83 | #define ELF64_FSZ_SXWORD 8 |
84 | typedef uint64_t Elf64_Xword; | | 84 | typedef uint64_t Elf64_Xword; |
85 | #define ELF64_FSZ_XWORD 8 | | 85 | #define ELF64_FSZ_XWORD 8 |
86 | typedef uint64_t Elf64_Lword; | | 86 | typedef uint64_t Elf64_Lword; |
87 | #define ELF64_FSZ_LWORD 8 | | 87 | #define ELF64_FSZ_LWORD 8 |
88 | typedef uint16_t Elf64_Half; | | 88 | typedef uint16_t Elf64_Half; |
89 | #define ELF64_FSZ_HALF 2 | | 89 | #define ELF64_FSZ_HALF 2 |
90 | | | 90 | |
91 | /* | | 91 | /* |
92 | * ELF Header | | 92 | * ELF Header |
93 | */ | | 93 | */ |
94 | #define ELF_NIDENT 16 | | 94 | #define ELF_NIDENT 16 |
95 | | | 95 | |
96 | typedef struct { | | 96 | typedef struct { |
97 | unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ | | 97 | unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ |
98 | Elf32_Half e_type; /* file type */ | | 98 | Elf32_Half e_type; /* file type */ |
99 | Elf32_Half e_machine; /* machine type */ | | 99 | Elf32_Half e_machine; /* machine type */ |
100 | Elf32_Word e_version; /* version number */ | | 100 | Elf32_Word e_version; /* version number */ |
101 | Elf32_Addr e_entry; /* entry point */ | | 101 | Elf32_Addr e_entry; /* entry point */ |
102 | Elf32_Off e_phoff; /* Program hdr offset */ | | 102 | Elf32_Off e_phoff; /* Program hdr offset */ |
103 | Elf32_Off e_shoff; /* Section hdr offset */ | | 103 | Elf32_Off e_shoff; /* Section hdr offset */ |
104 | Elf32_Word e_flags; /* Processor flags */ | | 104 | Elf32_Word e_flags; /* Processor flags */ |
105 | Elf32_Half e_ehsize; /* sizeof ehdr */ | | 105 | Elf32_Half e_ehsize; /* sizeof ehdr */ |
106 | Elf32_Half e_phentsize; /* Program header entry size */ | | 106 | Elf32_Half e_phentsize; /* Program header entry size */ |
107 | Elf32_Half e_phnum; /* Number of program headers */ | | 107 | Elf32_Half e_phnum; /* Number of program headers */ |
108 | Elf32_Half e_shentsize; /* Section header entry size */ | | 108 | Elf32_Half e_shentsize; /* Section header entry size */ |
109 | Elf32_Half e_shnum; /* Number of section headers */ | | 109 | Elf32_Half e_shnum; /* Number of section headers */ |
110 | Elf32_Half e_shstrndx; /* String table index */ | | 110 | Elf32_Half e_shstrndx; /* String table index */ |
111 | } Elf32_Ehdr; | | 111 | } Elf32_Ehdr; |
112 | | | 112 | |
113 | typedef struct { | | 113 | typedef struct { |
114 | unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ | | 114 | unsigned char e_ident[ELF_NIDENT]; /* Id bytes */ |
115 | Elf64_Half e_type; /* file type */ | | 115 | Elf64_Half e_type; /* file type */ |
116 | Elf64_Half e_machine; /* machine type */ | | 116 | Elf64_Half e_machine; /* machine type */ |
117 | Elf64_Word e_version; /* version number */ | | 117 | Elf64_Word e_version; /* version number */ |
118 | Elf64_Addr e_entry; /* entry point */ | | 118 | Elf64_Addr e_entry; /* entry point */ |
119 | Elf64_Off e_phoff; /* Program hdr offset */ | | 119 | Elf64_Off e_phoff; /* Program hdr offset */ |
120 | Elf64_Off e_shoff; /* Section hdr offset */ | | 120 | Elf64_Off e_shoff; /* Section hdr offset */ |
121 | Elf64_Word e_flags; /* Processor flags */ | | 121 | Elf64_Word e_flags; /* Processor flags */ |
122 | Elf64_Half e_ehsize; /* sizeof ehdr */ | | 122 | Elf64_Half e_ehsize; /* sizeof ehdr */ |
123 | Elf64_Half e_phentsize; /* Program header entry size */ | | 123 | Elf64_Half e_phentsize; /* Program header entry size */ |
124 | Elf64_Half e_phnum; /* Number of program headers */ | | 124 | Elf64_Half e_phnum; /* Number of program headers */ |
125 | Elf64_Half e_shentsize; /* Section header entry size */ | | 125 | Elf64_Half e_shentsize; /* Section header entry size */ |
126 | Elf64_Half e_shnum; /* Number of section headers */ | | 126 | Elf64_Half e_shnum; /* Number of section headers */ |
127 | Elf64_Half e_shstrndx; /* String table index */ | | 127 | Elf64_Half e_shstrndx; /* String table index */ |
128 | } Elf64_Ehdr; | | 128 | } Elf64_Ehdr; |
129 | | | 129 | |
130 | /* e_ident offsets */ | | 130 | /* e_ident offsets */ |
131 | #define EI_MAG0 0 /* '\177' */ | | 131 | #define EI_MAG0 0 /* '\177' */ |
132 | #define EI_MAG1 1 /* 'E' */ | | 132 | #define EI_MAG1 1 /* 'E' */ |
133 | #define EI_MAG2 2 /* 'L' */ | | 133 | #define EI_MAG2 2 /* 'L' */ |
134 | #define EI_MAG3 3 /* 'F' */ | | 134 | #define EI_MAG3 3 /* 'F' */ |
135 | #define EI_CLASS 4 /* File class */ | | 135 | #define EI_CLASS 4 /* File class */ |
136 | #define EI_DATA 5 /* Data encoding */ | | 136 | #define EI_DATA 5 /* Data encoding */ |
137 | #define EI_VERSION 6 /* File version */ | | 137 | #define EI_VERSION 6 /* File version */ |
138 | #define EI_OSABI 7 /* Operating system/ABI identification */ | | 138 | #define EI_OSABI 7 /* Operating system/ABI identification */ |
139 | #define EI_ABIVERSION 8 /* ABI version */ | | 139 | #define EI_ABIVERSION 8 /* ABI version */ |
140 | #define EI_PAD 9 /* Start of padding bytes up to EI_NIDENT*/ | | 140 | #define EI_PAD 9 /* Start of padding bytes up to EI_NIDENT*/ |
141 | #define EI_NIDENT 16 /* First non-ident header byte */ | | 141 | #define EI_NIDENT 16 /* First non-ident header byte */ |
142 | | | 142 | |
143 | /* e_ident[EI_MAG0,EI_MAG3] */ | | 143 | /* e_ident[EI_MAG0,EI_MAG3] */ |
144 | #define ELFMAG0 0x7f | | 144 | #define ELFMAG0 0x7f |
145 | #define ELFMAG1 'E' | | 145 | #define ELFMAG1 'E' |
146 | #define ELFMAG2 'L' | | 146 | #define ELFMAG2 'L' |
147 | #define ELFMAG3 'F' | | 147 | #define ELFMAG3 'F' |
148 | #define ELFMAG "\177ELF" | | 148 | #define ELFMAG "\177ELF" |
149 | #define SELFMAG 4 | | 149 | #define SELFMAG 4 |
150 | | | 150 | |
151 | /* e_ident[EI_CLASS] */ | | 151 | /* e_ident[EI_CLASS] */ |
152 | #define ELFCLASSNONE 0 /* Invalid class */ | | 152 | #define ELFCLASSNONE 0 /* Invalid class */ |
153 | #define ELFCLASS32 1 /* 32-bit objects */ | | 153 | #define ELFCLASS32 1 /* 32-bit objects */ |
154 | #define ELFCLASS64 2 /* 64-bit objects */ | | 154 | #define ELFCLASS64 2 /* 64-bit objects */ |
155 | #define ELFCLASSNUM 3 | | 155 | #define ELFCLASSNUM 3 |
156 | | | 156 | |
157 | /* e_ident[EI_DATA] */ | | 157 | /* e_ident[EI_DATA] */ |
158 | #define ELFDATANONE 0 /* Invalid data encoding */ | | 158 | #define ELFDATANONE 0 /* Invalid data encoding */ |
159 | #define ELFDATA2LSB 1 /* 2's complement values, LSB first */ | | 159 | #define ELFDATA2LSB 1 /* 2's complement values, LSB first */ |
160 | #define ELFDATA2MSB 2 /* 2's complement values, MSB first */ | | 160 | #define ELFDATA2MSB 2 /* 2's complement values, MSB first */ |
161 | | | 161 | |
162 | /* e_ident[EI_VERSION] */ | | 162 | /* e_ident[EI_VERSION] */ |
163 | #define EV_NONE 0 /* Invalid version */ | | 163 | #define EV_NONE 0 /* Invalid version */ |
164 | #define EV_CURRENT 1 /* Current version */ | | 164 | #define EV_CURRENT 1 /* Current version */ |
165 | #define EV_NUM 2 | | 165 | #define EV_NUM 2 |
166 | | | 166 | |
167 | /* e_ident[EI_OSABI] */ | | 167 | /* e_ident[EI_OSABI] */ |
168 | #define ELFOSABI_SYSV 0 /* UNIX System V ABI */ | | 168 | #define ELFOSABI_SYSV 0 /* UNIX System V ABI */ |
169 | #define ELFOSABI_HPUX 1 /* HP-UX operating system */ | | 169 | #define ELFOSABI_HPUX 1 /* HP-UX operating system */ |
170 | #define ELFOSABI_NETBSD 2 /* NetBSD */ | | 170 | #define ELFOSABI_NETBSD 2 /* NetBSD */ |
171 | #define ELFOSABI_LINUX 3 /* GNU/Linux */ | | 171 | #define ELFOSABI_LINUX 3 /* GNU/Linux */ |
172 | #define ELFOSABI_HURD 4 /* GNU/Hurd */ | | 172 | #define ELFOSABI_HURD 4 /* GNU/Hurd */ |
173 | #define ELFOSABI_86OPEN 5 /* 86Open */ | | 173 | #define ELFOSABI_86OPEN 5 /* 86Open */ |
174 | #define ELFOSABI_SOLARIS 6 /* Solaris */ | | 174 | #define ELFOSABI_SOLARIS 6 /* Solaris */ |
175 | #define ELFOSABI_MONTEREY 7 /* Monterey */ | | 175 | #define ELFOSABI_MONTEREY 7 /* Monterey */ |
176 | #define ELFOSABI_IRIX 8 /* IRIX */ | | 176 | #define ELFOSABI_IRIX 8 /* IRIX */ |
177 | #define ELFOSABI_FREEBSD 9 /* FreeBSD */ | | 177 | #define ELFOSABI_FREEBSD 9 /* FreeBSD */ |
178 | #define ELFOSABI_TRU64 10 /* TRU64 UNIX */ | | 178 | #define ELFOSABI_TRU64 10 /* TRU64 UNIX */ |
179 | #define ELFOSABI_MODESTO 11 /* Novell Modesto */ | | 179 | #define ELFOSABI_MODESTO 11 /* Novell Modesto */ |
180 | #define ELFOSABI_OPENBSD 12 /* OpenBSD */ | | 180 | #define ELFOSABI_OPENBSD 12 /* OpenBSD */ |
181 | #define ELFOSABI_OPENVMS 13 /* OpenVMS */ | | 181 | #define ELFOSABI_OPENVMS 13 /* OpenVMS */ |
182 | #define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ | | 182 | #define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ |
183 | #define ELFOSABI_AROS 15 /* Amiga Research OS */ | | 183 | #define ELFOSABI_AROS 15 /* Amiga Research OS */ |
184 | /* Unofficial OSABIs follow */ | | 184 | /* Unofficial OSABIs follow */ |
185 | #define ELFOSABI_ARM 97 /* ARM */ | | 185 | #define ELFOSABI_ARM 97 /* ARM */ |
186 | #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ | | 186 | #define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ |
187 | | | 187 | |
188 | #define ELFOSABI_NONE ELFOSABI_SYSV | | 188 | #define ELFOSABI_NONE ELFOSABI_SYSV |
189 | #define ELFOSABI_AIX ELFOSABI_MONTEREY | | 189 | #define ELFOSABI_AIX ELFOSABI_MONTEREY |
190 | | | 190 | |
191 | /* e_type */ | | 191 | /* e_type */ |
192 | #define ET_NONE 0 /* No file type */ | | 192 | #define ET_NONE 0 /* No file type */ |
193 | #define ET_REL 1 /* Relocatable file */ | | 193 | #define ET_REL 1 /* Relocatable file */ |
194 | #define ET_EXEC 2 /* Executable file */ | | 194 | #define ET_EXEC 2 /* Executable file */ |
195 | #define ET_DYN 3 /* Shared object file */ | | 195 | #define ET_DYN 3 /* Shared object file */ |
196 | #define ET_CORE 4 /* Core file */ | | 196 | #define ET_CORE 4 /* Core file */ |
197 | #define ET_NUM 5 | | 197 | #define ET_NUM 5 |
198 | | | 198 | |
199 | #define ET_LOOS 0xfe00 /* Operating system specific range */ | | 199 | #define ET_LOOS 0xfe00 /* Operating system specific range */ |
200 | #define ET_HIOS 0xfeff | | 200 | #define ET_HIOS 0xfeff |
201 | #define ET_LOPROC 0xff00 /* Processor-specific range */ | | 201 | #define ET_LOPROC 0xff00 /* Processor-specific range */ |
202 | #define ET_HIPROC 0xffff | | 202 | #define ET_HIPROC 0xffff |
203 | | | 203 | |
204 | /* e_machine */ | | 204 | /* e_machine */ |
205 | #define EM_NONE 0 /* No machine */ | | 205 | #define EM_NONE 0 /* No machine */ |
206 | #define EM_M32 1 /* AT&T WE 32100 */ | | 206 | #define EM_M32 1 /* AT&T WE 32100 */ |
207 | #define EM_SPARC 2 /* SPARC */ | | 207 | #define EM_SPARC 2 /* SPARC */ |
208 | #define EM_386 3 /* Intel 80386 */ | | 208 | #define EM_386 3 /* Intel 80386 */ |
209 | #define EM_68K 4 /* Motorola 68000 */ | | 209 | #define EM_68K 4 /* Motorola 68000 */ |
210 | #define EM_88K 5 /* Motorola 88000 */ | | 210 | #define EM_88K 5 /* Motorola 88000 */ |
211 | #define EM_486 6 /* Intel 80486 */ | | 211 | #define EM_486 6 /* Intel 80486 */ |
212 | #define EM_860 7 /* Intel 80860 */ | | 212 | #define EM_860 7 /* Intel 80860 */ |
213 | #define EM_MIPS 8 /* MIPS I Architecture */ | | 213 | #define EM_MIPS 8 /* MIPS I Architecture */ |
214 | #define EM_S370 9 /* Amdahl UTS on System/370 */ | | 214 | #define EM_S370 9 /* Amdahl UTS on System/370 */ |
215 | #define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */ | | 215 | #define EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */ |
216 | /* 11-14 - Reserved */ | | 216 | /* 11-14 - Reserved */ |
217 | #define EM_RS6000 11 /* IBM RS/6000 XXX reserved */ | | 217 | #define EM_RS6000 11 /* IBM RS/6000 XXX reserved */ |
218 | #define EM_PARISC 15 /* Hewlett-Packard PA-RISC */ | | 218 | #define EM_PARISC 15 /* Hewlett-Packard PA-RISC */ |
219 | #define EM_NCUBE 16 /* NCube XXX reserved */ | | 219 | #define EM_NCUBE 16 /* NCube XXX reserved */ |
220 | #define EM_VPP500 17 /* Fujitsu VPP500 */ | | 220 | #define EM_VPP500 17 /* Fujitsu VPP500 */ |
221 | #define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ | | 221 | #define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ |
222 | #define EM_960 19 /* Intel 80960 */ | | 222 | #define EM_960 19 /* Intel 80960 */ |
223 | #define EM_PPC 20 /* PowerPC */ | | 223 | #define EM_PPC 20 /* PowerPC */ |
224 | #define EM_PPC64 21 /* 64-bit PowerPC */ | | 224 | #define EM_PPC64 21 /* 64-bit PowerPC */ |
225 | /* 22-35 - Reserved */ | | 225 | /* 22-35 - Reserved */ |
226 | #define EM_S390 22 /* System/390 XXX reserved */ | | 226 | #define EM_S390 22 /* System/390 XXX reserved */ |
227 | #define EM_V800 36 /* NEC V800 */ | | 227 | #define EM_V800 36 /* NEC V800 */ |
228 | #define EM_FR20 37 /* Fujitsu FR20 */ | | 228 | #define EM_FR20 37 /* Fujitsu FR20 */ |
229 | #define EM_RH32 38 /* TRW RH-32 */ | | 229 | #define EM_RH32 38 /* TRW RH-32 */ |
230 | #define EM_RCE 39 /* Motorola RCE */ | | 230 | #define EM_RCE 39 /* Motorola RCE */ |
231 | #define EM_ARM 40 /* Advanced RISC Machines ARM */ | | 231 | #define EM_ARM 40 /* Advanced RISC Machines ARM */ |
232 | #define EM_ALPHA 41 /* DIGITAL Alpha */ | | 232 | #define EM_ALPHA 41 /* DIGITAL Alpha */ |
233 | #define EM_SH 42 /* Hitachi Super-H */ | | 233 | #define EM_SH 42 /* Hitachi Super-H */ |
234 | #define EM_SPARCV9 43 /* SPARC Version 9 */ | | 234 | #define EM_SPARCV9 43 /* SPARC Version 9 */ |
235 | #define EM_TRICORE 44 /* Siemens Tricore */ | | 235 | #define EM_TRICORE 44 /* Siemens Tricore */ |
236 | #define EM_ARC 45 /* Argonaut RISC Core */ | | 236 | #define EM_ARC 45 /* Argonaut RISC Core */ |
237 | #define EM_H8_300 46 /* Hitachi H8/300 */ | | 237 | #define EM_H8_300 46 /* Hitachi H8/300 */ |
238 | #define EM_H8_300H 47 /* Hitachi H8/300H */ | | 238 | #define EM_H8_300H 47 /* Hitachi H8/300H */ |
239 | #define EM_H8S 48 /* Hitachi H8S */ | | 239 | #define EM_H8S 48 /* Hitachi H8S */ |
240 | #define EM_H8_500 49 /* Hitachi H8/500 */ | | 240 | #define EM_H8_500 49 /* Hitachi H8/500 */ |
241 | #define EM_IA_64 50 /* Intel Merced Processor */ | | 241 | #define EM_IA_64 50 /* Intel Merced Processor */ |
242 | #define EM_MIPS_X 51 /* Stanford MIPS-X */ | | 242 | #define EM_MIPS_X 51 /* Stanford MIPS-X */ |
243 | #define EM_COLDFIRE 52 /* Motorola Coldfire */ | | 243 | #define EM_COLDFIRE 52 /* Motorola Coldfire */ |
244 | #define EM_68HC12 53 /* Motorola MC68HC12 */ | | 244 | #define EM_68HC12 53 /* Motorola MC68HC12 */ |
245 | #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ | | 245 | #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */ |
246 | #define EM_PCP 55 /* Siemens PCP */ | | 246 | #define EM_PCP 55 /* Siemens PCP */ |
247 | #define EM_NCPU 56 /* Sony nCPU embedded RISC processor */ | | 247 | #define EM_NCPU 56 /* Sony nCPU embedded RISC processor */ |
248 | #define EM_NDR1 57 /* Denso NDR1 microprocessor */ | | 248 | #define EM_NDR1 57 /* Denso NDR1 microprocessor */ |
249 | #define EM_STARCORE 58 /* Motorola Star*Core processor */ | | 249 | #define EM_STARCORE 58 /* Motorola Star*Core processor */ |
250 | #define EM_ME16 59 /* Toyota ME16 processor */ | | 250 | #define EM_ME16 59 /* Toyota ME16 processor */ |
251 | #define EM_ST100 60 /* STMicroelectronics ST100 processor */ | | 251 | #define EM_ST100 60 /* STMicroelectronics ST100 processor */ |
252 | #define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded family processor */ | | 252 | #define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded family processor */ |
253 | #define EM_X86_64 62 /* AMD x86-64 architecture */ | | 253 | #define EM_X86_64 62 /* AMD x86-64 architecture */ |
254 | #define EM_PDSP 63 /* Sony DSP Processor */ | | 254 | #define EM_PDSP 63 /* Sony DSP Processor */ |
255 | #define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */ | | 255 | #define EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */ |
256 | #define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */ | | 256 | #define EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */ |
257 | #define EM_FX66 66 /* Siemens FX66 microcontroller */ | | 257 | #define EM_FX66 66 /* Siemens FX66 microcontroller */ |
258 | #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ | | 258 | #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ |
259 | #define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */ | | 259 | #define EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */ |
260 | #define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */ | | 260 | #define EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */ |
261 | #define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */ | | 261 | #define EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */ |
262 | #define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */ | | 262 | #define EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */ |
263 | #define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */ | | 263 | #define EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */ |
264 | #define EM_SVX 73 /* Silicon Graphics SVx */ | | 264 | #define EM_SVX 73 /* Silicon Graphics SVx */ |
265 | #define EM_ST19 74 /* STMicroelectronics ST19 8-bit CPU */ | | 265 | #define EM_ST19 74 /* STMicroelectronics ST19 8-bit CPU */ |
266 | #define EM_VAX 75 /* Digital VAX */ | | 266 | #define EM_VAX 75 /* Digital VAX */ |
267 | #define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ | | 267 | #define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ |
268 | #define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded CPU */ | | 268 | #define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded CPU */ |
269 | #define EM_FIREPATH 78 /* Element 14 64-bit DSP processor */ | | 269 | #define EM_FIREPATH 78 /* Element 14 64-bit DSP processor */ |
270 | #define EM_ZSP 79 /* LSI Logic's 16-bit DSP processor */ | | 270 | #define EM_ZSP 79 /* LSI Logic's 16-bit DSP processor */ |
271 | #define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ | | 271 | #define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ |
272 | #define EM_HUANY 81 /* Harvard's machine-independent format */ | | 272 | #define EM_HUANY 81 /* Harvard's machine-independent format */ |
273 | #define EM_PRISM 82 /* SiTera Prism */ | | 273 | #define EM_PRISM 82 /* SiTera Prism */ |
274 | #define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ | | 274 | #define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ |
275 | #define EM_FR30 84 /* Fujitsu FR30 */ | | 275 | #define EM_FR30 84 /* Fujitsu FR30 */ |
276 | #define EM_D10V 85 /* Mitsubishi D10V */ | | 276 | #define EM_D10V 85 /* Mitsubishi D10V */ |
277 | #define EM_D30V 86 /* Mitsubishi D30V */ | | 277 | #define EM_D30V 86 /* Mitsubishi D30V */ |
278 | #define EM_V850 87 /* NEC v850 */ | | 278 | #define EM_V850 87 /* NEC v850 */ |
279 | #define EM_M32R 88 /* Mitsubishi M32R */ | | 279 | #define EM_M32R 88 /* Mitsubishi M32R */ |
280 | #define EM_MN10300 89 /* Matsushita MN10300 */ | | 280 | #define EM_MN10300 89 /* Matsushita MN10300 */ |
281 | #define EM_MN10200 90 /* Matsushita MN10200 */ | | 281 | #define EM_MN10200 90 /* Matsushita MN10200 */ |
282 | #define EM_PJ 91 /* picoJava */ | | 282 | #define EM_PJ 91 /* picoJava */ |
283 | #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ | | 283 | #define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ |
284 | #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ | | 284 | #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ |
285 | #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ | | 285 | #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ |
286 | #define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */ | | 286 | #define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */ |
287 | #define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */ | | 287 | #define EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */ |
288 | #define EM_NS32K 97 /* National Semiconductor 32000 series */ | | 288 | #define EM_NS32K 97 /* National Semiconductor 32000 series */ |
289 | #define EM_TPC 98 /* Tenor Network TPC processor */ | | 289 | #define EM_TPC 98 /* Tenor Network TPC processor */ |
290 | #define EM_SNP1K 99 /* Trebia SNP 1000 processor */ | | 290 | #define EM_SNP1K 99 /* Trebia SNP 1000 processor */ |
291 | #define EM_ST200 100 /* STMicroelectronics ST200 microcontroller */ | | 291 | #define EM_ST200 100 /* STMicroelectronics ST200 microcontroller */ |
292 | #define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */ | | 292 | #define EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */ |
293 | #define EM_MAX 102 /* MAX processor */ | | 293 | #define EM_MAX 102 /* MAX processor */ |
294 | #define EM_CR 103 /* National Semiconductor CompactRISC micorprocessor */ | | 294 | #define EM_CR 103 /* National Semiconductor CompactRISC micorprocessor */ |
295 | #define EM_F2MC16 104 /* Fujitsu F2MC16 */ | | 295 | #define EM_F2MC16 104 /* Fujitsu F2MC16 */ |
296 | #define EM_MSP430 105 /* Texas Instruments MSP430 */ | | 296 | #define EM_MSP430 105 /* Texas Instruments MSP430 */ |
297 | #define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */ | | 297 | #define EM_BLACKFIN 106 /* Analog Devices Blackfin DSP */ |
298 | #define EM_SE_C33 107 /* Seiko Epson S1C33 family */ | | 298 | #define EM_SE_C33 107 /* Seiko Epson S1C33 family */ |
299 | #define EM_SEP 108 /* Sharp embedded microprocessor */ | | 299 | #define EM_SEP 108 /* Sharp embedded microprocessor */ |
300 | #define EM_ARCA 109 /* Arca RISC microprocessor */ | | 300 | #define EM_ARCA 109 /* Arca RISC microprocessor */ |
301 | #define EM_UNICORE 110 /* UNICORE from PKU-Unity Ltd. and MPRC Peking University */ | | 301 | #define EM_UNICORE 110 /* UNICORE from PKU-Unity Ltd. and MPRC Peking University */ |
302 | #define EM_AARCH64 183 /* AArch64 64-bit ARM microprocessor */ | | 302 | #define EM_AARCH64 183 /* AArch64 64-bit ARM microprocessor */ |
303 | | | 303 | |
304 | /* Unofficial machine types follow */ | | 304 | /* Unofficial machine types follow */ |
305 | #define EM_AVR32 6317 /* used by NetBSD/avr32 */ | | 305 | #define EM_AVR32 6317 /* used by NetBSD/avr32 */ |
306 | #define EM_ALPHA_EXP 36902 /* used by NetBSD/alpha; obsolete */ | | 306 | #define EM_ALPHA_EXP 36902 /* used by NetBSD/alpha; obsolete */ |
307 | #define EM_NUM 36903 | | 307 | #define EM_NUM 36903 |
308 | | | 308 | |
309 | /* | | 309 | /* |
310 | * Program Header | | 310 | * Program Header |
311 | */ | | 311 | */ |
312 | typedef struct { | | 312 | typedef struct { |
313 | Elf32_Word p_type; /* entry type */ | | 313 | Elf32_Word p_type; /* entry type */ |
314 | Elf32_Off p_offset; /* offset */ | | 314 | Elf32_Off p_offset; /* offset */ |
315 | Elf32_Addr p_vaddr; /* virtual address */ | | 315 | Elf32_Addr p_vaddr; /* virtual address */ |
316 | Elf32_Addr p_paddr; /* physical address */ | | 316 | Elf32_Addr p_paddr; /* physical address */ |
317 | Elf32_Word p_filesz; /* file size */ | | 317 | Elf32_Word p_filesz; /* file size */ |
318 | Elf32_Word p_memsz; /* memory size */ | | 318 | Elf32_Word p_memsz; /* memory size */ |
319 | Elf32_Word p_flags; /* flags */ | | 319 | Elf32_Word p_flags; /* flags */ |
320 | Elf32_Word p_align; /* memory & file alignment */ | | 320 | Elf32_Word p_align; /* memory & file alignment */ |
321 | } Elf32_Phdr; | | 321 | } Elf32_Phdr; |
322 | | | 322 | |
323 | typedef struct { | | 323 | typedef struct { |
324 | Elf64_Word p_type; /* entry type */ | | 324 | Elf64_Word p_type; /* entry type */ |
325 | Elf64_Word p_flags; /* flags */ | | 325 | Elf64_Word p_flags; /* flags */ |
326 | Elf64_Off p_offset; /* offset */ | | 326 | Elf64_Off p_offset; /* offset */ |
327 | Elf64_Addr p_vaddr; /* virtual address */ | | 327 | Elf64_Addr p_vaddr; /* virtual address */ |
328 | Elf64_Addr p_paddr; /* physical address */ | | 328 | Elf64_Addr p_paddr; /* physical address */ |
329 | Elf64_Xword p_filesz; /* file size */ | | 329 | Elf64_Xword p_filesz; /* file size */ |
330 | Elf64_Xword p_memsz; /* memory size */ | | 330 | Elf64_Xword p_memsz; /* memory size */ |
331 | Elf64_Xword p_align; /* memory & file alignment */ | | 331 | Elf64_Xword p_align; /* memory & file alignment */ |
332 | } Elf64_Phdr; | | 332 | } Elf64_Phdr; |
333 | | | 333 | |
334 | /* p_type */ | | 334 | /* p_type */ |
335 | #define PT_NULL 0 /* Program header table entry unused */ | | 335 | #define PT_NULL 0 /* Program header table entry unused */ |
336 | #define PT_LOAD 1 /* Loadable program segment */ | | 336 | #define PT_LOAD 1 /* Loadable program segment */ |
337 | #define PT_DYNAMIC 2 /* Dynamic linking information */ | | 337 | #define PT_DYNAMIC 2 /* Dynamic linking information */ |
338 | #define PT_INTERP 3 /* Program interpreter */ | | 338 | #define PT_INTERP 3 /* Program interpreter */ |
339 | #define PT_NOTE 4 /* Auxiliary information */ | | 339 | #define PT_NOTE 4 /* Auxiliary information */ |
340 | #define PT_SHLIB 5 /* Reserved, unspecified semantics */ | | 340 | #define PT_SHLIB 5 /* Reserved, unspecified semantics */ |
341 | #define PT_PHDR 6 /* Entry for header table itself */ | | 341 | #define PT_PHDR 6 /* Entry for header table itself */ |
342 | #define PT_TLS 7 /* TLS initialisation image */ | | 342 | #define PT_TLS 7 /* TLS initialisation image */ |
343 | #define PT_NUM 8 | | 343 | #define PT_NUM 8 |
344 | | | 344 | |
345 | #define PT_LOOS 0x60000000 /* OS-specific range */ | | 345 | #define PT_LOOS 0x60000000 /* OS-specific range */ |
346 | | | 346 | |
347 | /* GNU-specific */ | | 347 | /* GNU-specific */ |
348 | #define PT_GNU_EH_FRAME 0x6474e550 /* EH frame segment */ | | 348 | #define PT_GNU_EH_FRAME 0x6474e550 /* EH frame segment */ |
349 | #define PT_GNU_STACK 0x6474e551 /* Indicate executable stack */ | | 349 | #define PT_GNU_STACK 0x6474e551 /* Indicate executable stack */ |
350 | #define PT_GNU_RELRO 0x6474e552 /* Make read-only after relocation */ | | 350 | #define PT_GNU_RELRO 0x6474e552 /* Make read-only after relocation */ |
351 | | | 351 | |
352 | #define PT_HIOS 0x6fffffff | | 352 | #define PT_HIOS 0x6fffffff |
353 | #define PT_LOPROC 0x70000000 /* Processor-specific range */ | | 353 | #define PT_LOPROC 0x70000000 /* Processor-specific range */ |
354 | #define PT_HIPROC 0x7fffffff | | 354 | #define PT_HIPROC 0x7fffffff |
355 | | | 355 | |
356 | #define PT_MIPS_REGINFO 0x70000000 | | 356 | #define PT_MIPS_REGINFO 0x70000000 |
357 | | | 357 | |
358 | /* p_flags */ | | 358 | /* p_flags */ |
359 | #define PF_R 0x4 /* Segment is readable */ | | 359 | #define PF_R 0x4 /* Segment is readable */ |
360 | #define PF_W 0x2 /* Segment is writable */ | | 360 | #define PF_W 0x2 /* Segment is writable */ |
361 | #define PF_X 0x1 /* Segment is executable */ | | 361 | #define PF_X 0x1 /* Segment is executable */ |
362 | | | 362 | |
363 | #define PF_MASKOS 0x0ff00000 /* Operating system specific values */ | | 363 | #define PF_MASKOS 0x0ff00000 /* Operating system specific values */ |
364 | #define PF_MASKPROC 0xf0000000 /* Processor-specific values */ | | 364 | #define PF_MASKPROC 0xf0000000 /* Processor-specific values */ |
365 | | | 365 | |
366 | /* Extended program header index. */ | | 366 | /* Extended program header index. */ |
367 | #define PN_XNUM 0xffff | | 367 | #define PN_XNUM 0xffff |
368 | | | 368 | |
369 | /* | | 369 | /* |
370 | * Section Headers | | 370 | * Section Headers |
371 | */ | | 371 | */ |
372 | typedef struct { | | 372 | typedef struct { |
373 | Elf32_Word sh_name; /* section name (.shstrtab index) */ | | 373 | Elf32_Word sh_name; /* section name (.shstrtab index) */ |
374 | Elf32_Word sh_type; /* section type */ | | 374 | Elf32_Word sh_type; /* section type */ |
375 | Elf32_Word sh_flags; /* section flags */ | | 375 | Elf32_Word sh_flags; /* section flags */ |
376 | Elf32_Addr sh_addr; /* virtual address */ | | 376 | Elf32_Addr sh_addr; /* virtual address */ |
377 | Elf32_Off sh_offset; /* file offset */ | | 377 | Elf32_Off sh_offset; /* file offset */ |
378 | Elf32_Word sh_size; /* section size */ | | 378 | Elf32_Word sh_size; /* section size */ |
379 | Elf32_Word sh_link; /* link to another */ | | 379 | Elf32_Word sh_link; /* link to another */ |
380 | Elf32_Word sh_info; /* misc info */ | | 380 | Elf32_Word sh_info; /* misc info */ |
381 | Elf32_Word sh_addralign; /* memory alignment */ | | 381 | Elf32_Word sh_addralign; /* memory alignment */ |
382 | Elf32_Word sh_entsize; /* table entry size */ | | 382 | Elf32_Word sh_entsize; /* table entry size */ |
383 | } Elf32_Shdr; | | 383 | } Elf32_Shdr; |
384 | | | 384 | |
385 | typedef struct { | | 385 | typedef struct { |
386 | Elf64_Word sh_name; /* section name (.shstrtab index) */ | | 386 | Elf64_Word sh_name; /* section name (.shstrtab index) */ |
387 | Elf64_Word sh_type; /* section type */ | | 387 | Elf64_Word sh_type; /* section type */ |
388 | Elf64_Xword sh_flags; /* section flags */ | | 388 | Elf64_Xword sh_flags; /* section flags */ |
389 | Elf64_Addr sh_addr; /* virtual address */ | | 389 | Elf64_Addr sh_addr; /* virtual address */ |
390 | Elf64_Off sh_offset; /* file offset */ | | 390 | Elf64_Off sh_offset; /* file offset */ |
391 | Elf64_Xword sh_size; /* section size */ | | 391 | Elf64_Xword sh_size; /* section size */ |
392 | Elf64_Word sh_link; /* link to another */ | | 392 | Elf64_Word sh_link; /* link to another */ |
393 | Elf64_Word sh_info; /* misc info */ | | 393 | Elf64_Word sh_info; /* misc info */ |
394 | Elf64_Xword sh_addralign; /* memory alignment */ | | 394 | Elf64_Xword sh_addralign; /* memory alignment */ |
395 | Elf64_Xword sh_entsize; /* table entry size */ | | 395 | Elf64_Xword sh_entsize; /* table entry size */ |
396 | } Elf64_Shdr; | | 396 | } Elf64_Shdr; |
397 | | | 397 | |
398 | /* sh_type */ | | 398 | /* sh_type */ |
399 | #define SHT_NULL 0 /* Section header table entry unused */ | | 399 | #define SHT_NULL 0 /* Section header table entry unused */ |
400 | #define SHT_PROGBITS 1 /* Program information */ | | 400 | #define SHT_PROGBITS 1 /* Program information */ |
401 | #define SHT_SYMTAB 2 /* Symbol table */ | | 401 | #define SHT_SYMTAB 2 /* Symbol table */ |
402 | #define SHT_STRTAB 3 /* String table */ | | 402 | #define SHT_STRTAB 3 /* String table */ |
403 | #define SHT_RELA 4 /* Relocation information w/ addend */ | | 403 | #define SHT_RELA 4 /* Relocation information w/ addend */ |
404 | #define SHT_HASH 5 /* Symbol hash table */ | | 404 | #define SHT_HASH 5 /* Symbol hash table */ |
405 | #define SHT_DYNAMIC 6 /* Dynamic linking information */ | | 405 | #define SHT_DYNAMIC 6 /* Dynamic linking information */ |
406 | #define SHT_NOTE 7 /* Auxiliary information */ | | 406 | #define SHT_NOTE 7 /* Auxiliary information */ |
407 | #define SHT_NOBITS 8 /* No space allocated in file image */ | | 407 | #define SHT_NOBITS 8 /* No space allocated in file image */ |
408 | #define SHT_REL 9 /* Relocation information w/o addend */ | | 408 | #define SHT_REL 9 /* Relocation information w/o addend */ |
409 | #define SHT_SHLIB 10 /* Reserved, unspecified semantics */ | | 409 | #define SHT_SHLIB 10 /* Reserved, unspecified semantics */ |
410 | #define SHT_DYNSYM 11 /* Symbol table for dynamic linker */ | | 410 | #define SHT_DYNSYM 11 /* Symbol table for dynamic linker */ |
411 | #define SHT_INIT_ARRAY 14 /* Initialization function pointers */ | | 411 | #define SHT_INIT_ARRAY 14 /* Initialization function pointers */ |
412 | #define SHT_FINI_ARRAY 15 /* Termination function pointers */ | | 412 | #define SHT_FINI_ARRAY 15 /* Termination function pointers */ |
413 | #define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs */ | | 413 | #define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs */ |
414 | #define SHT_GROUP 17 /* Section group */ | | 414 | #define SHT_GROUP 17 /* Section group */ |
415 | #define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX) */ | | 415 | #define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX) */ |
416 | #define SHT_NUM 19 | | 416 | #define SHT_NUM 19 |
417 | | | 417 | |
418 | #define SHT_LOOS 0x60000000 /* Operating system specific range */ | | 418 | #define SHT_LOOS 0x60000000 /* Operating system specific range */ |
419 | #define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700 /* GNU incremental build data */ | | 419 | #define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700 /* GNU incremental build data */ |
420 | #define SHT_LOSUNW 0x6ffffff4 | | 420 | #define SHT_LOSUNW 0x6ffffff4 |
421 | #define SHT_SUNW_dof 0x6ffffff4 | | 421 | #define SHT_SUNW_dof 0x6ffffff4 |
422 | #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* GNU object attributes */ | | 422 | #define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* GNU object attributes */ |
423 | #define SHT_SUNW_cap 0x6ffffff5 | | 423 | #define SHT_SUNW_cap 0x6ffffff5 |
424 | #define SHT_SUNW_SIGNATURE 0x6ffffff6 | | 424 | #define SHT_SUNW_SIGNATURE 0x6ffffff6 |
425 | #define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */ | | 425 | #define SHT_GNU_HASH 0x6ffffff6 /* GNU style symbol hash table */ |
426 | #define SHT_GNU_LIBLIST 0x6ffffff7 /* GNU list of prelink dependencies */ | | 426 | #define SHT_GNU_LIBLIST 0x6ffffff7 /* GNU list of prelink dependencies */ |
427 | #define SHT_SUNW_move 0x6ffffffa | | 427 | #define SHT_SUNW_move 0x6ffffffa |
428 | #define SHT_SUNW_COMDAT 0x6ffffffb | | 428 | #define SHT_SUNW_COMDAT 0x6ffffffb |
429 | #define SHT_SUNW_syminfo 0x6ffffffc | | 429 | #define SHT_SUNW_syminfo 0x6ffffffc |
430 | #define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */ | | 430 | #define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */ |
431 | #define SHT_GNU_verdef SHT_SUNW_verdef | | 431 | #define SHT_GNU_verdef SHT_SUNW_verdef |
432 | #define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */ | | 432 | #define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */ |
433 | #define SHT_GNU_verneed SHT_SUNW_verneed | | 433 | #define SHT_GNU_verneed SHT_SUNW_verneed |
434 | #define SHT_SUNW_versym 0x6fffffff /* Symbol versions */ | | 434 | #define SHT_SUNW_versym 0x6fffffff /* Symbol versions */ |
435 | #define SHT_GNU_versym SHT_SUNW_versym | | 435 | #define SHT_GNU_versym SHT_SUNW_versym |
436 | #define SHT_HISUNW 0x6fffffff | | 436 | #define SHT_HISUNW 0x6fffffff |
437 | #define SHT_HIOS 0x6fffffff | | 437 | #define SHT_HIOS 0x6fffffff |
438 | #define SHT_LOPROC 0x70000000 /* Processor-specific range */ | | 438 | #define SHT_LOPROC 0x70000000 /* Processor-specific range */ |
439 | #define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ | | 439 | #define SHT_AMD64_UNWIND 0x70000001 /* unwind information */ |
440 | #define SHT_ARM_EXIDX 0x70000001 /* exception index table */ | | 440 | #define SHT_ARM_EXIDX 0x70000001 /* exception index table */ |
441 | #define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking | | 441 | #define SHT_ARM_PREEMPTMAP 0x70000002 /* BPABI DLL dynamic linking |
442 | * pre-emption map */ | | 442 | * pre-emption map */ |
443 | #define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility | | 443 | #define SHT_ARM_ATTRIBUTES 0x70000003 /* Object file compatibility |
444 | * attributes */ | | 444 | * attributes */ |
445 | #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details */ | | 445 | #define SHT_ARM_DEBUGOVERLAY 0x70000004 /* See DBGOVL for details */ |
446 | #define SHT_ARM_OVERLAYSECTION 0x70000005 | | 446 | #define SHT_ARM_OVERLAYSECTION 0x70000005 |
447 | #define SHT_MIPS_REGINFO 0x70000006 | | 447 | #define SHT_MIPS_REGINFO 0x70000006 |
448 | #define SHT_MIPS_OPTIONS 0x7000000d | | 448 | #define SHT_MIPS_OPTIONS 0x7000000d |
449 | #define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */ | | 449 | #define SHT_MIPS_DWARF 0x7000001e /* MIPS gcc uses MIPS_DWARF */ |
450 | #define SHT_HIPROC 0x7fffffff | | 450 | #define SHT_HIPROC 0x7fffffff |
451 | #define SHT_LOUSER 0x80000000 /* Application-specific range */ | | 451 | #define SHT_LOUSER 0x80000000 /* Application-specific range */ |
452 | #define SHT_HIUSER 0xffffffff | | 452 | #define SHT_HIUSER 0xffffffff |
453 | | | 453 | |
454 | /* sh_flags */ | | 454 | /* sh_flags */ |
455 | #define SHF_WRITE 0x00000001 /* Contains writable data */ | | 455 | #define SHF_WRITE 0x00000001 /* Contains writable data */ |
456 | #define SHF_ALLOC 0x00000002 /* Occupies memory */ | | 456 | #define SHF_ALLOC 0x00000002 /* Occupies memory */ |
457 | #define SHF_EXECINSTR 0x00000004 /* Contains executable insns */ | | 457 | #define SHF_EXECINSTR 0x00000004 /* Contains executable insns */ |
458 | #define SHF_MERGE 0x00000010 /* Might be merged */ | | 458 | #define SHF_MERGE 0x00000010 /* Might be merged */ |
459 | #define SHF_STRINGS 0x00000020 /* Contains nul terminated strings */ | | 459 | #define SHF_STRINGS 0x00000020 /* Contains nul terminated strings */ |
460 | #define SHF_INFO_LINK 0x00000040 /* "sh_info" contains SHT index */ | | 460 | #define SHF_INFO_LINK 0x00000040 /* "sh_info" contains SHT index */ |
461 | #define SHF_LINK_ORDER 0x00000080 /* Preserve order after combining */ | | 461 | #define SHF_LINK_ORDER 0x00000080 /* Preserve order after combining */ |
462 | #define SHF_OS_NONCONFORMING 0x00000100 /* OS specific handling required */ | | 462 | #define SHF_OS_NONCONFORMING 0x00000100 /* OS specific handling required */ |
463 | #define SHF_GROUP 0x00000200 /* Is member of a group */ | | 463 | #define SHF_GROUP 0x00000200 /* Is member of a group */ |
464 | #define SHF_TLS 0x00000400 /* Holds thread-local data */ | | 464 | #define SHF_TLS 0x00000400 /* Holds thread-local data */ |
465 | #define SHF_MASKOS 0x0ff00000 /* Operating system specific values */ | | 465 | #define SHF_MASKOS 0x0ff00000 /* Operating system specific values */ |
466 | #define SHF_MASKPROC 0xf0000000 /* Processor-specific values */ | | 466 | #define SHF_MASKPROC 0xf0000000 /* Processor-specific values */ |
467 | #define SHF_ORDERED 0x40000000 /* Ordering requirement (Solaris) */ | | 467 | #define SHF_ORDERED 0x40000000 /* Ordering requirement (Solaris) */ |
468 | #define SHF_EXCLUDE 0x80000000 /* Excluded unless unles ref/alloc | | 468 | #define SHF_EXCLUDE 0x80000000 /* Excluded unless unles ref/alloc |
469 | (Solaris).*/ | | 469 | (Solaris).*/ |
470 | /* | | 470 | /* |
471 | * Symbol Table | | 471 | * Symbol Table |
472 | */ | | 472 | */ |
473 | typedef struct { | | 473 | typedef struct { |
474 | Elf32_Word st_name; /* Symbol name (.strtab index) */ | | 474 | Elf32_Word st_name; /* Symbol name (.strtab index) */ |
475 | Elf32_Word st_value; /* value of symbol */ | | 475 | Elf32_Word st_value; /* value of symbol */ |
476 | Elf32_Word st_size; /* size of symbol */ | | 476 | Elf32_Word st_size; /* size of symbol */ |
477 | Elf_Byte st_info; /* type / binding attrs */ | | 477 | Elf_Byte st_info; /* type / binding attrs */ |
478 | Elf_Byte st_other; /* unused */ | | 478 | Elf_Byte st_other; /* unused */ |
479 | Elf32_Half st_shndx; /* section index of symbol */ | | 479 | Elf32_Half st_shndx; /* section index of symbol */ |
480 | } Elf32_Sym; | | 480 | } Elf32_Sym; |
481 | | | 481 | |
482 | typedef struct { | | 482 | typedef struct { |
483 | Elf64_Word st_name; /* Symbol name (.strtab index) */ | | 483 | Elf64_Word st_name; /* Symbol name (.strtab index) */ |
484 | Elf_Byte st_info; /* type / binding attrs */ | | 484 | Elf_Byte st_info; /* type / binding attrs */ |
485 | Elf_Byte st_other; /* unused */ | | 485 | Elf_Byte st_other; /* unused */ |
486 | Elf64_Half st_shndx; /* section index of symbol */ | | 486 | Elf64_Half st_shndx; /* section index of symbol */ |
487 | Elf64_Addr st_value; /* value of symbol */ | | 487 | Elf64_Addr st_value; /* value of symbol */ |
488 | Elf64_Xword st_size; /* size of symbol */ | | 488 | Elf64_Xword st_size; /* size of symbol */ |
489 | } Elf64_Sym; | | 489 | } Elf64_Sym; |
490 | | | 490 | |
491 | /* Symbol Table index of the undefined symbol */ | | 491 | /* Symbol Table index of the undefined symbol */ |
492 | #define ELF_SYM_UNDEFINED 0 | | 492 | #define ELF_SYM_UNDEFINED 0 |
493 | | | 493 | |
494 | #define STN_UNDEF 0 /* undefined index */ | | 494 | #define STN_UNDEF 0 /* undefined index */ |
495 | | | 495 | |
496 | /* st_info: Symbol Bindings */ | | 496 | /* st_info: Symbol Bindings */ |
497 | #define STB_LOCAL 0 /* local symbol */ | | 497 | #define STB_LOCAL 0 /* local symbol */ |
498 | #define STB_GLOBAL 1 /* global symbol */ | | 498 | #define STB_GLOBAL 1 /* global symbol */ |
499 | #define STB_WEAK 2 /* weakly defined global symbol */ | | 499 | #define STB_WEAK 2 /* weakly defined global symbol */ |
500 | #define STB_NUM 3 | | 500 | #define STB_NUM 3 |
501 | | | 501 | |
502 | #define STB_LOOS 10 /* Operating system specific range */ | | 502 | #define STB_LOOS 10 /* Operating system specific range */ |
503 | #define STB_HIOS 12 | | 503 | #define STB_HIOS 12 |
504 | #define STB_LOPROC 13 /* Processor-specific range */ | | 504 | #define STB_LOPROC 13 /* Processor-specific range */ |
505 | #define STB_HIPROC 15 | | 505 | #define STB_HIPROC 15 |
506 | | | 506 | |
507 | /* st_info: Symbol Types */ | | 507 | /* st_info: Symbol Types */ |
508 | #define STT_NOTYPE 0 /* Type not specified */ | | 508 | #define STT_NOTYPE 0 /* Type not specified */ |
509 | #define STT_OBJECT 1 /* Associated with a data object */ | | 509 | #define STT_OBJECT 1 /* Associated with a data object */ |
510 | #define STT_FUNC 2 /* Associated with a function */ | | 510 | #define STT_FUNC 2 /* Associated with a function */ |
511 | #define STT_SECTION 3 /* Associated with a section */ | | 511 | #define STT_SECTION 3 /* Associated with a section */ |
512 | #define STT_FILE 4 /* Associated with a file name */ | | 512 | #define STT_FILE 4 /* Associated with a file name */ |
513 | #define STT_COMMON 5 /* Uninitialised common block */ | | 513 | #define STT_COMMON 5 /* Uninitialised common block */ |
514 | #define STT_TLS 6 /* Thread local data object */ | | 514 | #define STT_TLS 6 /* Thread local data object */ |
515 | #define STT_NUM 7 | | 515 | #define STT_NUM 7 |
516 | | | 516 | |
517 | #define STT_LOOS 10 /* Operating system specific range */ | | 517 | #define STT_LOOS 10 /* Operating system specific range */ |
518 | #define STT_HIOS 12 | | 518 | #define STT_HIOS 12 |
519 | #define STT_LOPROC 13 /* Processor-specific range */ | | 519 | #define STT_LOPROC 13 /* Processor-specific range */ |
520 | #define STT_HIPROC 15 | | 520 | #define STT_HIPROC 15 |
521 | | | 521 | |
522 | /* st_other: Visibility Types */ | | 522 | /* st_other: Visibility Types */ |
523 | #define STV_DEFAULT 0 /* use binding type */ | | 523 | #define STV_DEFAULT 0 /* use binding type */ |
524 | #define STV_INTERNAL 1 /* not referenced from outside */ | | 524 | #define STV_INTERNAL 1 /* not referenced from outside */ |
525 | #define STV_HIDDEN 2 /* not visible, may be used via ptr */ | | 525 | #define STV_HIDDEN 2 /* not visible, may be used via ptr */ |
526 | #define STV_PROTECTED 3 /* visible, not preemptible */ | | 526 | #define STV_PROTECTED 3 /* visible, not preemptible */ |
527 | #define STV_EXPORTED 4 | | 527 | #define STV_EXPORTED 4 |
528 | #define STV_SINGLETON 5 | | 528 | #define STV_SINGLETON 5 |
529 | #define STV_ELIMINATE 6 | | 529 | #define STV_ELIMINATE 6 |
530 | | | 530 | |
531 | /* st_info/st_other utility macros */ | | 531 | /* st_info/st_other utility macros */ |
532 | #define ELF_ST_BIND(info) ((uint32_t)(info) >> 4) | | 532 | #define ELF_ST_BIND(info) ((uint32_t)(info) >> 4) |
533 | #define ELF_ST_TYPE(info) ((uint32_t)(info) & 0xf) | | 533 | #define ELF_ST_TYPE(info) ((uint32_t)(info) & 0xf) |
534 | #define ELF_ST_INFO(bind,type) ((Elf_Byte)(((bind) << 4) | \ | | 534 | #define ELF_ST_INFO(bind,type) ((Elf_Byte)(((bind) << 4) | \ |
535 | ((type) & 0xf))) | | 535 | ((type) & 0xf))) |
536 | #define ELF_ST_VISIBILITY(other) ((uint32_t)(other) & 3) | | 536 | #define ELF_ST_VISIBILITY(other) ((uint32_t)(other) & 3) |
537 | | | 537 | |
538 | /* | | 538 | /* |
539 | * Special section indexes | | 539 | * Special section indexes |
540 | */ | | 540 | */ |
541 | #define SHN_UNDEF 0 /* Undefined section */ | | 541 | #define SHN_UNDEF 0 /* Undefined section */ |
542 | | | 542 | |
543 | #define SHN_LORESERVE 0xff00 /* Reserved range */ | | 543 | #define SHN_LORESERVE 0xff00 /* Reserved range */ |
544 | #define SHN_ABS 0xfff1 /* Absolute symbols */ | | 544 | #define SHN_ABS 0xfff1 /* Absolute symbols */ |
545 | #define SHN_COMMON 0xfff2 /* Common symbols */ | | 545 | #define SHN_COMMON 0xfff2 /* Common symbols */ |
546 | #define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere */ | | 546 | #define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere */ |
547 | #define SHN_HIRESERVE 0xffff | | 547 | #define SHN_HIRESERVE 0xffff |
548 | | | 548 | |
549 | #define SHN_LOPROC 0xff00 /* Processor-specific range */ | | 549 | #define SHN_LOPROC 0xff00 /* Processor-specific range */ |
550 | #define SHN_HIPROC 0xff1f | | 550 | #define SHN_HIPROC 0xff1f |
551 | #define SHN_LOOS 0xff20 /* Operating system specific range */ | | 551 | #define SHN_LOOS 0xff20 /* Operating system specific range */ |
552 | #define SHN_HIOS 0xff3f | | 552 | #define SHN_HIOS 0xff3f |
553 | | | 553 | |
554 | #define SHN_MIPS_ACOMMON 0xff00 | | 554 | #define SHN_MIPS_ACOMMON 0xff00 |
555 | #define SHN_MIPS_TEXT 0xff01 | | 555 | #define SHN_MIPS_TEXT 0xff01 |
556 | #define SHN_MIPS_DATA 0xff02 | | 556 | #define SHN_MIPS_DATA 0xff02 |
557 | #define SHN_MIPS_SCOMMON 0xff03 | | 557 | #define SHN_MIPS_SCOMMON 0xff03 |
558 | | | 558 | |
559 | /* | | 559 | /* |
560 | * Relocation Entries | | 560 | * Relocation Entries |
561 | */ | | 561 | */ |
562 | typedef struct { | | 562 | typedef struct { |
563 | Elf32_Word r_offset; /* where to do it */ | | 563 | Elf32_Word r_offset; /* where to do it */ |
564 | Elf32_Word r_info; /* index & type of relocation */ | | 564 | Elf32_Word r_info; /* index & type of relocation */ |
565 | } Elf32_Rel; | | 565 | } Elf32_Rel; |
566 | | | 566 | |
567 | typedef struct { | | 567 | typedef struct { |
568 | Elf32_Word r_offset; /* where to do it */ | | 568 | Elf32_Word r_offset; /* where to do it */ |
569 | Elf32_Word r_info; /* index & type of relocation */ | | 569 | Elf32_Word r_info; /* index & type of relocation */ |
570 | Elf32_Sword r_addend; /* adjustment value */ | | 570 | Elf32_Sword r_addend; /* adjustment value */ |
571 | } Elf32_Rela; | | 571 | } Elf32_Rela; |
572 | | | 572 | |
573 | /* r_info utility macros */ | | 573 | /* r_info utility macros */ |
574 | #define ELF32_R_SYM(info) ((info) >> 8) | | 574 | #define ELF32_R_SYM(info) ((info) >> 8) |
575 | #define ELF32_R_TYPE(info) ((info) & 0xff) | | 575 | #define ELF32_R_TYPE(info) ((info) & 0xff) |
576 | #define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) | | 576 | #define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) |
577 | | | 577 | |
578 | typedef struct { | | 578 | typedef struct { |
579 | Elf64_Addr r_offset; /* where to do it */ | | 579 | Elf64_Addr r_offset; /* where to do it */ |
580 | Elf64_Xword r_info; /* index & type of relocation */ | | 580 | Elf64_Xword r_info; /* index & type of relocation */ |
581 | } Elf64_Rel; | | 581 | } Elf64_Rel; |
582 | | | 582 | |
583 | typedef struct { | | 583 | typedef struct { |
584 | Elf64_Addr r_offset; /* where to do it */ | | 584 | Elf64_Addr r_offset; /* where to do it */ |
585 | Elf64_Xword r_info; /* index & type of relocation */ | | 585 | Elf64_Xword r_info; /* index & type of relocation */ |
586 | Elf64_Sxword r_addend; /* adjustment value */ | | 586 | Elf64_Sxword r_addend; /* adjustment value */ |
587 | } Elf64_Rela; | | 587 | } Elf64_Rela; |
588 | | | 588 | |
589 | /* r_info utility macros */ | | 589 | /* r_info utility macros */ |
590 | #define ELF64_R_SYM(info) ((info) >> 32) | | 590 | #define ELF64_R_SYM(info) ((info) >> 32) |
591 | #define ELF64_R_TYPE(info) ((info) & 0xffffffff) | | 591 | #define ELF64_R_TYPE(info) ((info) & 0xffffffff) |
592 | #define ELF64_R_INFO(sym,type) (((sym) << 32) + (type)) | | 592 | #define ELF64_R_INFO(sym,type) (((sym) << 32) + (type)) |
593 | | | 593 | |
594 | /* | | 594 | /* |
595 | * Move entries | | 595 | * Move entries |
596 | */ | | 596 | */ |
597 | typedef struct { | | 597 | typedef struct { |
598 | Elf32_Lword m_value; /* symbol value */ | | 598 | Elf32_Lword m_value; /* symbol value */ |
599 | Elf32_Word m_info; /* size + index */ | | 599 | Elf32_Word m_info; /* size + index */ |
600 | Elf32_Word m_poffset; /* symbol offset */ | | 600 | Elf32_Word m_poffset; /* symbol offset */ |
601 | Elf32_Half m_repeat; /* repeat count */ | | 601 | Elf32_Half m_repeat; /* repeat count */ |
602 | Elf32_Half m_stride; /* stride info */ | | 602 | Elf32_Half m_stride; /* stride info */ |
603 | } Elf32_Move; | | 603 | } Elf32_Move; |
604 | | | 604 | |
605 | #define ELF32_M_SYM(info) ((info) >> 8) | | 605 | #define ELF32_M_SYM(info) ((info) >> 8) |
606 | #define ELF32_M_SIZE(info) ((info) & 0xff) | | 606 | #define ELF32_M_SIZE(info) ((info) & 0xff) |
607 | #define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) | | 607 | #define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) |
608 | | | 608 | |
609 | typedef struct { | | 609 | typedef struct { |
610 | Elf64_Lword m_value; /* symbol value */ | | 610 | Elf64_Lword m_value; /* symbol value */ |
611 | Elf64_Xword m_info; /* size + index */ | | 611 | Elf64_Xword m_info; /* size + index */ |
612 | Elf64_Xword m_poffset; /* symbol offset */ | | 612 | Elf64_Xword m_poffset; /* symbol offset */ |
613 | Elf64_Word m_repeat; /* repeat count */ | | 613 | Elf64_Word m_repeat; /* repeat count */ |
614 | Elf64_Word m_stride; /* stride info */ | | 614 | Elf64_Word m_stride; /* stride info */ |
615 | } Elf64_Move; | | 615 | } Elf64_Move; |
616 | | | 616 | |
617 | #define ELF64_M_SYM(info) ((info) >> 8) | | 617 | #define ELF64_M_SYM(info) ((info) >> 8) |
618 | #define ELF64_M_SIZE(info) ((info) & 0xff) | | 618 | #define ELF64_M_SIZE(info) ((info) & 0xff) |
619 | #define ELF64_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) | | 619 | #define ELF64_M_INFO(sym, size) (((sym) << 8) + (unsigned char)(size)) |
620 | | | 620 | |
621 | /* | | 621 | /* |
622 | * Hardware/software capabilities entry | | 622 | * Hardware/software capabilities entry |
623 | */ | | 623 | */ |
624 | typedef struct { | | 624 | typedef struct { |
625 | Elf32_Word c_tag; /* entry tag value */ | | 625 | Elf32_Word c_tag; /* entry tag value */ |
626 | union { | | 626 | union { |
627 | Elf32_Addr c_ptr; | | 627 | Elf32_Addr c_ptr; |
628 | Elf32_Word c_val; | | 628 | Elf32_Word c_val; |
629 | } c_un; | | 629 | } c_un; |
630 | } Elf32_Cap; | | 630 | } Elf32_Cap; |
631 | | | 631 | |
632 | typedef struct { | | 632 | typedef struct { |
633 | Elf64_Xword c_tag; /* entry tag value */ | | 633 | Elf64_Xword c_tag; /* entry tag value */ |
634 | union { | | 634 | union { |
635 | Elf64_Addr c_ptr; | | 635 | Elf64_Addr c_ptr; |
636 | Elf64_Xword c_val; | | 636 | Elf64_Xword c_val; |
637 | } c_un; | | 637 | } c_un; |
638 | } Elf64_Cap; | | 638 | } Elf64_Cap; |
639 | | | 639 | |
640 | /* | | 640 | /* |
641 | * Dynamic Section structure array | | 641 | * Dynamic Section structure array |
642 | */ | | 642 | */ |
643 | typedef struct { | | 643 | typedef struct { |
644 | Elf32_Word d_tag; /* entry tag value */ | | 644 | Elf32_Word d_tag; /* entry tag value */ |
645 | union { | | 645 | union { |
646 | Elf32_Addr d_ptr; | | 646 | Elf32_Addr d_ptr; |
647 | Elf32_Word d_val; | | 647 | Elf32_Word d_val; |
648 | } d_un; | | 648 | } d_un; |
649 | } Elf32_Dyn; | | 649 | } Elf32_Dyn; |
650 | | | 650 | |
651 | typedef struct { | | 651 | typedef struct { |
652 | Elf64_Xword d_tag; /* entry tag value */ | | 652 | Elf64_Xword d_tag; /* entry tag value */ |
653 | union { | | 653 | union { |
654 | Elf64_Addr d_ptr; | | 654 | Elf64_Addr d_ptr; |
655 | Elf64_Xword d_val; | | 655 | Elf64_Xword d_val; |
656 | } d_un; | | 656 | } d_un; |
657 | } Elf64_Dyn; | | 657 | } Elf64_Dyn; |
658 | | | 658 | |
659 | /* d_tag */ | | 659 | /* d_tag */ |
660 | #define DT_NULL 0 /* Marks end of dynamic array */ | | 660 | #define DT_NULL 0 /* Marks end of dynamic array */ |
661 | #define DT_NEEDED 1 /* Name of needed library (DT_STRTAB offset) */ | | 661 | #define DT_NEEDED 1 /* Name of needed library (DT_STRTAB offset) */ |
662 | #define DT_PLTRELSZ 2 /* Size, in bytes, of relocations in PLT */ | | 662 | #define DT_PLTRELSZ 2 /* Size, in bytes, of relocations in PLT */ |
663 | #define DT_PLTGOT 3 /* Address of PLT and/or GOT */ | | 663 | #define DT_PLTGOT 3 /* Address of PLT and/or GOT */ |
664 | #define DT_HASH 4 /* Address of symbol hash table */ | | 664 | #define DT_HASH 4 /* Address of symbol hash table */ |
665 | #define DT_STRTAB 5 /* Address of string table */ | | 665 | #define DT_STRTAB 5 /* Address of string table */ |
666 | #define DT_SYMTAB 6 /* Address of symbol table */ | | 666 | #define DT_SYMTAB 6 /* Address of symbol table */ |
667 | #define DT_RELA 7 /* Address of Rela relocation table */ | | 667 | #define DT_RELA 7 /* Address of Rela relocation table */ |
668 | #define DT_RELASZ 8 /* Size, in bytes, of DT_RELA table */ | | 668 | #define DT_RELASZ 8 /* Size, in bytes, of DT_RELA table */ |
669 | #define DT_RELAENT 9 /* Size, in bytes, of one DT_RELA entry */ | | 669 | #define DT_RELAENT 9 /* Size, in bytes, of one DT_RELA entry */ |
670 | #define DT_STRSZ 10 /* Size, in bytes, of DT_STRTAB table */ | | 670 | #define DT_STRSZ 10 /* Size, in bytes, of DT_STRTAB table */ |
671 | #define DT_SYMENT 11 /* Size, in bytes, of one DT_SYMTAB entry */ | | 671 | #define DT_SYMENT 11 /* Size, in bytes, of one DT_SYMTAB entry */ |
672 | #define DT_INIT 12 /* Address of initialization function */ | | 672 | #define DT_INIT 12 /* Address of initialization function */ |
673 | #define DT_FINI 13 /* Address of termination function */ | | 673 | #define DT_FINI 13 /* Address of termination function */ |
674 | #define DT_SONAME 14 /* Shared object name (DT_STRTAB offset) */ | | 674 | #define DT_SONAME 14 /* Shared object name (DT_STRTAB offset) */ |
675 | #define DT_RPATH 15 /* Library search path (DT_STRTAB offset) */ | | 675 | #define DT_RPATH 15 /* Library search path (DT_STRTAB offset) */ |
676 | #define DT_SYMBOLIC 16 /* Start symbol search within local object */ | | 676 | #define DT_SYMBOLIC 16 /* Start symbol search within local object */ |
677 | #define DT_REL 17 /* Address of Rel relocation table */ | | 677 | #define DT_REL 17 /* Address of Rel relocation table */ |
678 | #define DT_RELSZ 18 /* Size, in bytes, of DT_REL table */ | | 678 | #define DT_RELSZ 18 /* Size, in bytes, of DT_REL table */ |
679 | #define DT_RELENT 19 /* Size, in bytes, of one DT_REL entry */ | | 679 | #define DT_RELENT 19 /* Size, in bytes, of one DT_REL entry */ |
680 | #define DT_PLTREL 20 /* Type of PLT relocation entries */ | | 680 | #define DT_PLTREL 20 /* Type of PLT relocation entries */ |
681 | #define DT_DEBUG 21 /* Used for debugging; unspecified */ | | 681 | #define DT_DEBUG 21 /* Used for debugging; unspecified */ |
682 | #define DT_TEXTREL 22 /* Relocations might modify non-writable seg */ | | 682 | #define DT_TEXTREL 22 /* Relocations might modify non-writable seg */ |
683 | #define DT_JMPREL 23 /* Address of relocations associated with PLT */ | | 683 | #define DT_JMPREL 23 /* Address of relocations associated with PLT */ |
684 | #define DT_BIND_NOW 24 /* Process all relocations at load-time */ | | 684 | #define DT_BIND_NOW 24 /* Process all relocations at load-time */ |
685 | #define DT_INIT_ARRAY 25 /* Address of initialization function array */ | | 685 | #define DT_INIT_ARRAY 25 /* Address of initialization function array */ |
686 | #define DT_FINI_ARRAY 26 /* Size, in bytes, of DT_INIT_ARRAY array */ | | 686 | #define DT_FINI_ARRAY 26 /* Size, in bytes, of DT_INIT_ARRAY array */ |
687 | #define DT_INIT_ARRAYSZ 27 /* Address of termination function array */ | | 687 | #define DT_INIT_ARRAYSZ 27 /* Address of termination function array */ |
688 | #define DT_FINI_ARRAYSZ 28 /* Size, in bytes, of DT_FINI_ARRAY array*/ | | 688 | #define DT_FINI_ARRAYSZ 28 /* Size, in bytes, of DT_FINI_ARRAY array*/ |
689 | #define DT_RUNPATH 29 /* overrides DT_RPATH */ | | 689 | #define DT_RUNPATH 29 /* overrides DT_RPATH */ |
690 | #define DT_FLAGS 30 /* Encodes ORIGIN, SYMBOLIC, TEXTREL, BIND_NOW, STATIC_TLS */ | | 690 | #define DT_FLAGS 30 /* Encodes ORIGIN, SYMBOLIC, TEXTREL, BIND_NOW, STATIC_TLS */ |
691 | #define DT_ENCODING 31 /* ??? */ | | 691 | #define DT_ENCODING 31 /* ??? */ |
692 | #define DT_PREINIT_ARRAY 32 /* Address of pre-init function array */ | | 692 | #define DT_PREINIT_ARRAY 32 /* Address of pre-init function array */ |
693 | #define DT_PREINIT_ARRAYSZ 33 /* Size, in bytes, of DT_PREINIT_ARRAY array */ | | 693 | #define DT_PREINIT_ARRAYSZ 33 /* Size, in bytes, of DT_PREINIT_ARRAY array */ |
694 | #define DT_NUM 34 | | 694 | #define DT_NUM 34 |
695 | | | 695 | |
696 | #define DT_LOOS 0x60000000 /* Operating system specific range */ | | 696 | #define DT_LOOS 0x60000000 /* Operating system specific range */ |
697 | #define DT_VERSYM 0x6ffffff0 /* Symbol versions */ | | 697 | #define DT_VERSYM 0x6ffffff0 /* Symbol versions */ |
698 | #define DT_FLAGS_1 0x6ffffffb /* ELF dynamic flags */ | | 698 | #define DT_FLAGS_1 0x6ffffffb /* ELF dynamic flags */ |
699 | #define DT_VERDEF 0x6ffffffc /* Versions defined by file */ | | 699 | #define DT_VERDEF 0x6ffffffc /* Versions defined by file */ |
700 | #define DT_VERDEFNUM 0x6ffffffd /* Number of versions defined by file */ | | 700 | #define DT_VERDEFNUM 0x6ffffffd /* Number of versions defined by file */ |
701 | #define DT_VERNEED 0x6ffffffe /* Versions needed by file */ | | 701 | #define DT_VERNEED 0x6ffffffe /* Versions needed by file */ |
702 | #define DT_VERNEEDNUM 0x6fffffff /* Number of versions needed by file */ | | 702 | #define DT_VERNEEDNUM 0x6fffffff /* Number of versions needed by file */ |
703 | #define DT_HIOS 0x6fffffff | | 703 | #define DT_HIOS 0x6fffffff |
704 | #define DT_LOPROC 0x70000000 /* Processor-specific range */ | | 704 | #define DT_LOPROC 0x70000000 /* Processor-specific range */ |
705 | #define DT_HIPROC 0x7fffffff | | 705 | #define DT_HIPROC 0x7fffffff |
706 | | | 706 | |
707 | /* Flag values for DT_FLAGS */ | | 707 | /* Flag values for DT_FLAGS */ |
708 | #define DF_ORIGIN 0x00000001 /* uses $ORIGIN */ | | 708 | #define DF_ORIGIN 0x00000001 /* uses $ORIGIN */ |
709 | #define DF_SYMBOLIC 0x00000002 /* */ | | 709 | #define DF_SYMBOLIC 0x00000002 /* */ |
710 | #define DF_TEXTREL 0x00000004 /* */ | | 710 | #define DF_TEXTREL 0x00000004 /* */ |
711 | #define DF_BIND_NOW 0x00000008 /* */ | | 711 | #define DF_BIND_NOW 0x00000008 /* */ |
712 | #define DF_STATIC_TLS 0x00000010 /* */ | | 712 | #define DF_STATIC_TLS 0x00000010 /* */ |
713 | | | 713 | |
714 | /* Flag values for DT_FLAGS_1 (incomplete) */ | | 714 | /* Flag values for DT_FLAGS_1 (incomplete) */ |
715 | #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ | | 715 | #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ |
716 | #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ | | 716 | #define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ |
717 | #define DF_1_INITFIRST 0x00000020 /* Object's init/fini take priority */ | | 717 | #define DF_1_INITFIRST 0x00000020 /* Object's init/fini take priority */ |
718 | #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ | | 718 | #define DF_1_NOOPEN 0x00000040 /* Do not allow loading on dlopen() */ |
719 | | | 719 | |
720 | /* | | 720 | /* |
721 | * Auxiliary Vectors | | 721 | * Auxiliary Vectors |
722 | */ | | 722 | */ |
723 | typedef struct { | | 723 | typedef struct { |
724 | Elf32_Word a_type; /* 32-bit id */ | | 724 | Elf32_Word a_type; /* 32-bit id */ |
725 | Elf32_Word a_v; /* 32-bit id */ | | 725 | Elf32_Word a_v; /* 32-bit id */ |
726 | } Aux32Info; | | 726 | } Aux32Info; |
727 | | | 727 | |
728 | typedef struct { | | 728 | typedef struct { |
729 | Elf64_Word a_type; /* 32-bit id */ | | 729 | Elf64_Word a_type; /* 32-bit id */ |
730 | Elf64_Xword a_v; /* 64-bit id */ | | 730 | Elf64_Xword a_v; /* 64-bit id */ |
731 | } Aux64Info; | | 731 | } Aux64Info; |
732 | | | 732 | |
733 | /* a_type */ | | 733 | /* a_type */ |
734 | #define AT_NULL 0 /* Marks end of array */ | | 734 | #define AT_NULL 0 /* Marks end of array */ |
735 | #define AT_IGNORE 1 /* No meaning, a_un is undefined */ | | 735 | #define AT_IGNORE 1 /* No meaning, a_un is undefined */ |
736 | #define AT_EXECFD 2 /* Open file descriptor of object file */ | | 736 | #define AT_EXECFD 2 /* Open file descriptor of object file */ |
737 | #define AT_PHDR 3 /* &phdr[0] */ | | 737 | #define AT_PHDR 3 /* &phdr[0] */ |
738 | #define AT_PHENT 4 /* sizeof(phdr[0]) */ | | 738 | #define AT_PHENT 4 /* sizeof(phdr[0]) */ |
739 | #define AT_PHNUM 5 /* # phdr entries */ | | 739 | #define AT_PHNUM 5 /* # phdr entries */ |
740 | #define AT_PAGESZ 6 /* PAGESIZE */ | | 740 | #define AT_PAGESZ 6 /* PAGESIZE */ |
741 | #define AT_BASE 7 /* Interpreter base addr */ | | 741 | #define AT_BASE 7 /* Interpreter base addr */ |
742 | #define AT_FLAGS 8 /* Processor flags */ | | 742 | #define AT_FLAGS 8 /* Processor flags */ |
743 | #define AT_ENTRY 9 /* Entry address of executable */ | | 743 | #define AT_ENTRY 9 /* Entry address of executable */ |
744 | #define AT_DCACHEBSIZE 10 /* Data cache block size */ | | 744 | #define AT_DCACHEBSIZE 10 /* Data cache block size */ |
745 | #define AT_ICACHEBSIZE 11 /* Instruction cache block size */ | | 745 | #define AT_ICACHEBSIZE 11 /* Instruction cache block size */ |
746 | #define AT_UCACHEBSIZE 12 /* Unified cache block size */ | | 746 | #define AT_UCACHEBSIZE 12 /* Unified cache block size */ |
747 | #define AT_STACKBASE 13 /* Base address of the main thread */ | | 747 | #define AT_STACKBASE 13 /* Base address of the main thread */ |
748 | | | 748 | |
749 | /* Vendor specific */ | | 749 | /* Vendor specific */ |
750 | #define AT_MIPS_NOTELF 10 /* XXX a_val != 0 -> MIPS XCOFF executable */ | | 750 | #define AT_MIPS_NOTELF 10 /* XXX a_val != 0 -> MIPS XCOFF executable */ |
751 | | | 751 | |
752 | #define AT_EUID 2000 /* euid (solaris compatible numbers) */ | | 752 | #define AT_EUID 2000 /* euid (solaris compatible numbers) */ |
753 | #define AT_RUID 2001 /* ruid (solaris compatible numbers) */ | | 753 | #define AT_RUID 2001 /* ruid (solaris compatible numbers) */ |
754 | #define AT_EGID 2002 /* egid (solaris compatible numbers) */ | | 754 | #define AT_EGID 2002 /* egid (solaris compatible numbers) */ |
755 | #define AT_RGID 2003 /* rgid (solaris compatible numbers) */ | | 755 | #define AT_RGID 2003 /* rgid (solaris compatible numbers) */ |
756 | | | 756 | |
757 | /* Solaris kernel specific */ | | 757 | /* Solaris kernel specific */ |
758 | #define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */ | | 758 | #define AT_SUN_LDELF 2004 /* dynamic linker's ELF header */ |
759 | #define AT_SUN_LDSHDR 2005 /* dynamic linker's section header */ | | 759 | #define AT_SUN_LDSHDR 2005 /* dynamic linker's section header */ |
760 | #define AT_SUN_LDNAME 2006 /* dynamic linker's name */ | | 760 | #define AT_SUN_LDNAME 2006 /* dynamic linker's name */ |
761 | #define AT_SUN_LPGSIZE 2007 /* large pagesize */ | | 761 | #define AT_SUN_LPGSIZE 2007 /* large pagesize */ |
762 | | | 762 | |
763 | /* Other information */ | | 763 | /* Other information */ |
764 | #define AT_SUN_PLATFORM 2008 /* sysinfo(SI_PLATFORM) */ | | 764 | #define AT_SUN_PLATFORM 2008 /* sysinfo(SI_PLATFORM) */ |
765 | #define AT_SUN_HWCAP 2009 /* process hardware capabilities */ | | 765 | #define AT_SUN_HWCAP 2009 /* process hardware capabilities */ |
766 | #define AT_SUN_IFLUSH 2010 /* do we need to flush the instruction cache? */ | | 766 | #define AT_SUN_IFLUSH 2010 /* do we need to flush the instruction cache? */ |
767 | #define AT_SUN_CPU 2011 /* CPU name */ | | 767 | #define AT_SUN_CPU 2011 /* CPU name */ |
768 | /* ibcs2 emulation band aid */ | | 768 | /* ibcs2 emulation band aid */ |
769 | #define AT_SUN_EMUL_ENTRY 2012 /* coff entry point */ | | 769 | #define AT_SUN_EMUL_ENTRY 2012 /* coff entry point */ |
770 | #define AT_SUN_EMUL_EXECFD 2013 /* coff file descriptor */ | | 770 | #define AT_SUN_EMUL_EXECFD 2013 /* coff file descriptor */ |
771 | /* Executable's fully resolved name */ | | 771 | /* Executable's fully resolved name */ |
772 | #define AT_SUN_EXECNAME 2014 | | 772 | #define AT_SUN_EXECNAME 2014 |
773 | | | 773 | |
774 | /* | | 774 | /* |
775 | * The header for GNU-style hash sections. | | 775 | * The header for GNU-style hash sections. |
776 | */ | | 776 | */ |
777 | typedef struct { | | 777 | typedef struct { |
778 | uint32_t gh_nbuckets; /* Number of hash buckets. */ | | 778 | uint32_t gh_nbuckets; /* Number of hash buckets. */ |
779 | uint32_t gh_symndx; /* First visible symbol in .dynsym. */ | | 779 | uint32_t gh_symndx; /* First visible symbol in .dynsym. */ |
780 | uint32_t gh_maskwords; /* #maskwords used in bloom filter. */ | | 780 | uint32_t gh_maskwords; /* #maskwords used in bloom filter. */ |
781 | uint32_t gh_shift2; /* Bloom filter shift count. */ | | 781 | uint32_t gh_shift2; /* Bloom filter shift count. */ |
782 | } Elf_GNU_Hash_Header; | | 782 | } Elf_GNU_Hash_Header; |
783 | | | 783 | |
784 | /* | | 784 | /* |
785 | * Note Headers | | 785 | * Note Headers |
786 | */ | | 786 | */ |
787 | typedef struct { | | 787 | typedef struct { |
788 | Elf32_Word n_namesz; | | 788 | Elf32_Word n_namesz; |
789 | Elf32_Word n_descsz; | | 789 | Elf32_Word n_descsz; |
790 | Elf32_Word n_type; | | 790 | Elf32_Word n_type; |
791 | } Elf32_Nhdr; | | 791 | } Elf32_Nhdr; |
792 | | | 792 | |
793 | typedef struct { | | 793 | typedef struct { |
794 | Elf64_Word n_namesz; | | 794 | Elf64_Word n_namesz; |
795 | Elf64_Word n_descsz; | | 795 | Elf64_Word n_descsz; |
796 | Elf64_Word n_type; | | 796 | Elf64_Word n_type; |
797 | } Elf64_Nhdr; | | 797 | } Elf64_Nhdr; |
798 | | | 798 | |
799 | #define ELF_NOTE_GNU_NAMESZ 4 | | 799 | #define ELF_NOTE_GNU_NAMESZ 4 |
800 | #define ELF_NOTE_GNU_NAME "GNU\0" | | 800 | #define ELF_NOTE_GNU_NAME "GNU\0" |
801 | | | 801 | |
802 | /* | | 802 | /* |
803 | * GNU-specific note type: ABI tag | | 803 | * GNU-specific note type: ABI tag |
804 | * name: GNU\0 | | 804 | * name: GNU\0 |
805 | * namesz: 4 | | 805 | * namesz: 4 |
806 | * desc: | | 806 | * desc: |
807 | * word[0]: OS tag | | 807 | * word[0]: OS tag |
808 | * word[1]: major version | | 808 | * word[1]: major version |
809 | * word[2]: minor version | | 809 | * word[2]: minor version |
810 | * word[3]: teeny version | | 810 | * word[3]: teeny version |
811 | * descsz: 16 | | 811 | * descsz: 16 |
812 | */ | | 812 | */ |
813 | /* GNU-specific note name and description sizes */ | | 813 | /* GNU-specific note name and description sizes */ |
814 | #define ELF_NOTE_TYPE_ABI_TAG 1 | | 814 | #define ELF_NOTE_TYPE_ABI_TAG 1 |
815 | #define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME | | 815 | #define ELF_NOTE_ABI_NAME ELF_NOTE_GNU_NAME |
816 | #define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ | | 816 | #define ELF_NOTE_ABI_NAMESZ ELF_NOTE_GNU_NAMESZ |
817 | #define ELF_NOTE_ABI_DESCSZ 16 | | 817 | #define ELF_NOTE_ABI_DESCSZ 16 |
818 | /* GNU-specific OS/version value stuff */ | | 818 | /* GNU-specific OS/version value stuff */ |
819 | #define ELF_NOTE_ABI_OS_LINUX 0 | | 819 | #define ELF_NOTE_ABI_OS_LINUX 0 |
820 | #define ELF_NOTE_ABI_OS_HURD 1 | | 820 | #define ELF_NOTE_ABI_OS_HURD 1 |
821 | #define ELF_NOTE_ABI_OS_SOLARIS 2 | | 821 | #define ELF_NOTE_ABI_OS_SOLARIS 2 |
822 | #define ELF_NOTE_ABI_OS_KFREEBSD 3 | | 822 | #define ELF_NOTE_ABI_OS_KFREEBSD 3 |
823 | #define ELF_NOTE_ABI_OS_KNETBSD 4 | | 823 | #define ELF_NOTE_ABI_OS_KNETBSD 4 |
824 | | | 824 | |
| | | 825 | /* Old gcc style, under the ABI tag */ |
| | | 826 | #define ELF_NOTE_OGCC_NAMESZ 8 |
| | | 827 | #define ELF_NOTE_OGCC_NAME "01.01\0\0\0\0" |
| | | 828 | #define ELF_NOTE_OGCC_DESCSZ 0 |
| | | 829 | |
825 | /* | | 830 | /* |
826 | * GNU-specific note type: Hardware capabilities | | 831 | * GNU-specific note type: Hardware capabilities |
827 | * name: GNU\0 | | 832 | * name: GNU\0 |
828 | * namesz: 4 | | 833 | * namesz: 4 |
829 | * desc: | | 834 | * desc: |
830 | * word[0]: Number of entries | | 835 | * word[0]: Number of entries |
831 | * word[1]: Bitmask of enabled entries | | 836 | * word[1]: Bitmask of enabled entries |
832 | * Followed by a byte id, and a NUL terminated string per entry | | 837 | * Followed by a byte id, and a NUL terminated string per entry |
833 | * descsz: variable | | 838 | * descsz: variable |
834 | */ | | 839 | */ |
835 | #define ELF_NOTE_TYPE_GNU_HWCAP 2 | | 840 | #define ELF_NOTE_TYPE_GNU_HWCAP 2 |
836 | | | 841 | |
837 | /* | | 842 | /* |
838 | * GNU-specific note type: Build ID generated by ld | | 843 | * GNU-specific note type: Build ID generated by ld |
839 | * name: GNU\0 | | 844 | * name: GNU\0 |
840 | * desc: | | 845 | * desc: |
841 | * word[0..4] SHA1 [default] | | 846 | * word[0..4] SHA1 [default] |
842 | * or | | 847 | * or |
843 | * word[0..3] md5 or uuid | | 848 | * word[0..3] md5 or uuid |
844 | * descsz: 16 or 20 | | 849 | * descsz: 16 or 20 |
845 | */ | | 850 | */ |
846 | #define ELF_NOTE_TYPE_GNU_BUILD_ID 3 | | 851 | #define ELF_NOTE_TYPE_GNU_BUILD_ID 3 |
847 | | | 852 | |
848 | /* SuSE-specific note type: ABI | | 853 | /* SuSE-specific note type: ABI |
849 | * name: SuSE\0 | | 854 | * name: SuSE\0 |
850 | * namesz: 5 | | 855 | * namesz: 5 |
851 | * desc: | | 856 | * desc: |
852 | * half[0] = MMmm | | 857 | * half[0] = MMmm |
853 | * | | 858 | * |
854 | * M = product major version | | 859 | * M = product major version |
855 | * m = product minor version | | 860 | * m = product minor version |
856 | * descsz: 2 | | 861 | * descsz: 2 |
857 | */ | | 862 | */ |
858 | #define ELF_NOTE_TYPE_SUSE_TAG 1 | | 863 | #define ELF_NOTE_TYPE_SUSE_TAG 1 |
859 | /* SuSE-specific note name and description sizes */ | | 864 | /* SuSE-specific note name and description sizes */ |
860 | #define ELF_NOTE_SUSE_NAMESZ 5 | | 865 | #define ELF_NOTE_SUSE_NAMESZ 5 |
861 | #define ELF_NOTE_SUSE_DESCSZ 2 | | 866 | #define ELF_NOTE_SUSE_DESCSZ 2 |
862 | /* SuSE-specific note name */ | | 867 | /* SuSE-specific note name */ |
863 | #define ELF_NOTE_SUSE_NAME "SuSE\0" | | 868 | #define ELF_NOTE_SUSE_NAME "SuSE\0" |
864 | | | 869 | |
865 | /* SuSE-specific note type: version | | 870 | /* SuSE-specific note type: version |
866 | * name: SuSE\0\0\0\0 | | 871 | * name: SuSE\0\0\0\0 |
867 | * namesz: 8 | | 872 | * namesz: 8 |
868 | * desc: | | 873 | * desc: |
869 | * word[0] = VVTTMMmm | | 874 | * word[0] = VVTTMMmm |
870 | * | | 875 | * |
871 | * V = version of following data | | 876 | * V = version of following data |
872 | * T = product type: [box, sles, nld, whatever] | | 877 | * T = product type: [box, sles, nld, whatever] |
873 | * M = product major version | | 878 | * M = product major version |
874 | * m = product minor version | | 879 | * m = product minor version |
875 | * descsz: 8 | | 880 | * descsz: 8 |
876 | */ | | 881 | */ |
877 | #define ELF_NOTE_TYPE_SUSE_VERSION_TAG 0x45537553 /* SuSE in LE */ | | 882 | #define ELF_NOTE_TYPE_SUSE_VERSION_TAG 0x45537553 /* SuSE in LE */ |
878 | /* SuSE-specific note name and description sizes */ | | 883 | /* SuSE-specific note name and description sizes */ |
879 | #define ELF_NOTE_SUSE_VERSION_NAMESZ 8 | | 884 | #define ELF_NOTE_SUSE_VERSION_NAMESZ 8 |
880 | #define ELF_NOTE_SUSE_VERSION_DESCSZ 8 | | 885 | #define ELF_NOTE_SUSE_VERSION_DESCSZ 8 |
881 | /* SuSE-specific note name */ | | 886 | /* SuSE-specific note name */ |
882 | #define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0" | | 887 | #define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0" |
883 | | | 888 | |
| | | 889 | /* Go-specific note type: buildid |
| | | 890 | * name: Go\0\0 |
| | | 891 | * namesz: 4 |
| | | 892 | * desc: |
| | | 893 | * words[10] |
| | | 894 | * descsz: 40 |
| | | 895 | */ |
| | | 896 | #define ELF_NOTE_TYPE_GO_BUILDID_TAG 4 |
| | | 897 | #define ELF_NOTE_GO_BUILDID_NAMESZ 4 |
| | | 898 | #define ELF_NOTE_GO_BUILDID_DESCSZ 40 |
| | | 899 | #define ELF_NOTE_GO_BUILDID_NAME "Go\0\0" |
| | | 900 | |
884 | /* NetBSD-specific note type: Emulation name. | | 901 | /* NetBSD-specific note type: Emulation name. |
885 | * name: NetBSD\0\0 | | 902 | * name: NetBSD\0\0 |
886 | * namesz: 8 | | 903 | * namesz: 8 |
887 | * desc: | | 904 | * desc: |
888 | * word[0]: MMmmrrpp00 | | 905 | * word[0]: MMmmrrpp00 |
889 | * | | 906 | * |
890 | * M = major version | | 907 | * M = major version |
891 | * m = minor version | | 908 | * m = minor version |
892 | * r = release ["",A-Z,Z[A-Z] but numeric] | | 909 | * r = release ["",A-Z,Z[A-Z] but numeric] |
893 | * p = patchlevel | | 910 | * p = patchlevel |
894 | * descsz: 4 | | 911 | * descsz: 4 |
895 | */ | | 912 | */ |
896 | #define ELF_NOTE_TYPE_NETBSD_TAG 1 | | 913 | #define ELF_NOTE_TYPE_NETBSD_TAG 1 |
897 | /* NetBSD-specific note name and description sizes */ | | 914 | /* NetBSD-specific note name and description sizes */ |
898 | #define ELF_NOTE_NETBSD_NAMESZ 7 | | 915 | #define ELF_NOTE_NETBSD_NAMESZ 7 |
899 | #define ELF_NOTE_NETBSD_DESCSZ 4 | | 916 | #define ELF_NOTE_NETBSD_DESCSZ 4 |
900 | /* NetBSD-specific note name */ | | 917 | /* NetBSD-specific note name */ |
901 | #define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" | | 918 | #define ELF_NOTE_NETBSD_NAME "NetBSD\0\0" |
902 | | | 919 | |
903 | /* NetBSD-specific note type: Checksum. | | 920 | /* NetBSD-specific note type: Checksum. |
904 | * There should be 1 NOTE per PT_LOAD section. | | 921 | * There should be 1 NOTE per PT_LOAD section. |
905 | * name: ??? | | 922 | * name: ??? |
906 | * namesz: ??? | | 923 | * namesz: ??? |
907 | * desc: | | 924 | * desc: |
908 | * a tuple of <phnum>(16),<chk-type>(16),<chk-value>. | | 925 | * a tuple of <phnum>(16),<chk-type>(16),<chk-value>. |
909 | * descsz: ??? | | 926 | * descsz: ??? |
910 | */ | | 927 | */ |
911 | #define ELF_NOTE_TYPE_CHECKSUM_TAG 2 | | 928 | #define ELF_NOTE_TYPE_CHECKSUM_TAG 2 |
912 | #define ELF_NOTE_CHECKSUM_CRC32 1 | | 929 | #define ELF_NOTE_CHECKSUM_CRC32 1 |
913 | #define ELF_NOTE_CHECKSUM_MD5 2 | | 930 | #define ELF_NOTE_CHECKSUM_MD5 2 |
914 | #define ELF_NOTE_CHECKSUM_SHA1 3 | | 931 | #define ELF_NOTE_CHECKSUM_SHA1 3 |
915 | #define ELF_NOTE_CHECKSUM_SHA256 4 | | 932 | #define ELF_NOTE_CHECKSUM_SHA256 4 |
916 | | | 933 | |
917 | /* | | 934 | /* |
918 | * NetBSD-specific note type: PaX. | | 935 | * NetBSD-specific note type: PaX. |
919 | * There should be 1 NOTE per executable. | | 936 | * There should be 1 NOTE per executable. |
920 | * name: PaX\0 | | 937 | * name: PaX\0 |
921 | * namesz: 4 | | 938 | * namesz: 4 |
922 | * desc: | | 939 | * desc: |
923 | * word[0]: capability bitmask | | 940 | * word[0]: capability bitmask |
924 | * descsz: 4 | | 941 | * descsz: 4 |
925 | */ | | 942 | */ |
926 | #define ELF_NOTE_TYPE_PAX_TAG 3 | | 943 | #define ELF_NOTE_TYPE_PAX_TAG 3 |
927 | #define ELF_NOTE_PAX_MPROTECT 0x01 /* Force enable Mprotect */ | | 944 | #define ELF_NOTE_PAX_MPROTECT 0x01 /* Force enable Mprotect */ |
928 | #define ELF_NOTE_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */ | | 945 | #define ELF_NOTE_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */ |
929 | #define ELF_NOTE_PAX_GUARD 0x04 /* Force enable Segvguard */ | | 946 | #define ELF_NOTE_PAX_GUARD 0x04 /* Force enable Segvguard */ |
930 | #define ELF_NOTE_PAX_NOGUARD 0x08 /* Force disable Servguard */ | | 947 | #define ELF_NOTE_PAX_NOGUARD 0x08 /* Force disable Servguard */ |
931 | #define ELF_NOTE_PAX_ASLR 0x10 /* Force enable ASLR */ | | 948 | #define ELF_NOTE_PAX_ASLR 0x10 /* Force enable ASLR */ |
932 | #define ELF_NOTE_PAX_NOASLR 0x20 /* Force disable ASLR */ | | 949 | #define ELF_NOTE_PAX_NOASLR 0x20 /* Force disable ASLR */ |
933 | #define ELF_NOTE_PAX_NAMESZ 4 | | 950 | #define ELF_NOTE_PAX_NAMESZ 4 |
934 | #define ELF_NOTE_PAX_NAME "PaX\0" | | 951 | #define ELF_NOTE_PAX_NAME "PaX\0" |
935 | #define ELF_NOTE_PAX_DESCSZ 4 | | 952 | #define ELF_NOTE_PAX_DESCSZ 4 |
936 | | | 953 | |
937 | /* | | 954 | /* |
938 | * NetBSD-specific core file information. | | 955 | * NetBSD-specific core file information. |
939 | * | | 956 | * |
940 | * NetBSD ELF core files use notes to provide information about | | 957 | * NetBSD ELF core files use notes to provide information about |
941 | * the process's state. The note name is "NetBSD-CORE" for | | 958 | * the process's state. The note name is "NetBSD-CORE" for |
942 | * information that is global to the process, and "NetBSD-CORE@nn", | | 959 | * information that is global to the process, and "NetBSD-CORE@nn", |
943 | * where "nn" is the lwpid of the LWP that the information belongs | | 960 | * where "nn" is the lwpid of the LWP that the information belongs |
944 | * to (such as register state). | | 961 | * to (such as register state). |
945 | * | | 962 | * |
946 | * We use the following note identifiers: | | 963 | * We use the following note identifiers: |
947 | * | | 964 | * |
948 | * ELF_NOTE_NETBSD_CORE_PROCINFO | | 965 | * ELF_NOTE_NETBSD_CORE_PROCINFO |
949 | * Note is a "netbsd_elfcore_procinfo" structure. | | 966 | * Note is a "netbsd_elfcore_procinfo" structure. |
950 | * | | 967 | * |
951 | * We also use ptrace(2) request numbers (the ones that exist in | | 968 | * We also use ptrace(2) request numbers (the ones that exist in |
952 | * machine-dependent space) to identify register info notes. The | | 969 | * machine-dependent space) to identify register info notes. The |
953 | * info in such notes is in the same format that ptrace(2) would | | 970 | * info in such notes is in the same format that ptrace(2) would |
954 | * export that information. | | 971 | * export that information. |
955 | * | | 972 | * |
956 | * Please try to keep the members of this structure nicely aligned, | | 973 | * Please try to keep the members of this structure nicely aligned, |
957 | * and if you add elements, add them to the end and bump the version. | | 974 | * and if you add elements, add them to the end and bump the version. |
958 | */ | | 975 | */ |
959 | | | 976 | |
960 | #define ELF_NOTE_NETBSD_CORE_NAME "NetBSD-CORE" | | 977 | #define ELF_NOTE_NETBSD_CORE_NAME "NetBSD-CORE" |
961 | | | 978 | |
962 | #define ELF_NOTE_NETBSD_CORE_PROCINFO 1 | | 979 | #define ELF_NOTE_NETBSD_CORE_PROCINFO 1 |
963 | | | 980 | |
964 | #define NETBSD_ELFCORE_PROCINFO_VERSION 1 | | 981 | #define NETBSD_ELFCORE_PROCINFO_VERSION 1 |
965 | | | 982 | |
966 | struct netbsd_elfcore_procinfo { | | 983 | struct netbsd_elfcore_procinfo { |
967 | /* Version 1 fields start here. */ | | 984 | /* Version 1 fields start here. */ |
968 | uint32_t cpi_version; /* our version */ | | 985 | uint32_t cpi_version; /* our version */ |
969 | uint32_t cpi_cpisize; /* sizeof(this struct) */ | | 986 | uint32_t cpi_cpisize; /* sizeof(this struct) */ |
970 | uint32_t cpi_signo; /* killing signal */ | | 987 | uint32_t cpi_signo; /* killing signal */ |
971 | uint32_t cpi_sigcode; /* signal code */ | | 988 | uint32_t cpi_sigcode; /* signal code */ |
972 | uint32_t cpi_sigpend[4]; /* pending signals */ | | 989 | uint32_t cpi_sigpend[4]; /* pending signals */ |
973 | uint32_t cpi_sigmask[4]; /* blocked signals */ | | 990 | uint32_t cpi_sigmask[4]; /* blocked signals */ |
974 | uint32_t cpi_sigignore[4]; /* ignored signals */ | | 991 | uint32_t cpi_sigignore[4]; /* ignored signals */ |
975 | uint32_t cpi_sigcatch[4]; /* caught signals */ | | 992 | uint32_t cpi_sigcatch[4]; /* caught signals */ |
976 | int32_t cpi_pid; /* process ID */ | | 993 | int32_t cpi_pid; /* process ID */ |
977 | int32_t cpi_ppid; /* parent process ID */ | | 994 | int32_t cpi_ppid; /* parent process ID */ |
978 | int32_t cpi_pgrp; /* process group ID */ | | 995 | int32_t cpi_pgrp; /* process group ID */ |
979 | int32_t cpi_sid; /* session ID */ | | 996 | int32_t cpi_sid; /* session ID */ |
980 | uint32_t cpi_ruid; /* real user ID */ | | 997 | uint32_t cpi_ruid; /* real user ID */ |
981 | uint32_t cpi_euid; /* effective user ID */ | | 998 | uint32_t cpi_euid; /* effective user ID */ |
982 | uint32_t cpi_svuid; /* saved user ID */ | | 999 | uint32_t cpi_svuid; /* saved user ID */ |
983 | uint32_t cpi_rgid; /* real group ID */ | | 1000 | uint32_t cpi_rgid; /* real group ID */ |
984 | uint32_t cpi_egid; /* effective group ID */ | | 1001 | uint32_t cpi_egid; /* effective group ID */ |
985 | uint32_t cpi_svgid; /* saved group ID */ | | 1002 | uint32_t cpi_svgid; /* saved group ID */ |
986 | uint32_t cpi_nlwps; /* number of LWPs */ | | 1003 | uint32_t cpi_nlwps; /* number of LWPs */ |
987 | int8_t cpi_name[32]; /* copy of p->p_comm */ | | 1004 | int8_t cpi_name[32]; /* copy of p->p_comm */ |
988 | /* Add version 2 fields below here. */ | | 1005 | /* Add version 2 fields below here. */ |
989 | int32_t cpi_siglwp; /* LWP target of killing signal */ | | 1006 | int32_t cpi_siglwp; /* LWP target of killing signal */ |
990 | }; | | 1007 | }; |
991 | | | 1008 | |
992 | /* | | 1009 | /* |
993 | * NetBSD-specific note type: MACHINE_ARCH. | | 1010 | * NetBSD-specific note type: MACHINE_ARCH. |
994 | * There should be 1 NOTE per executable. | | 1011 | * There should be 1 NOTE per executable. |
995 | * name: NetBSD\0 | | 1012 | * name: NetBSD\0 |
996 | * namesz: 7 | | 1013 | * namesz: 7 |
997 | * desc: string | | 1014 | * desc: string |
998 | * descsz: variable | | 1015 | * descsz: variable |
999 | */ | | 1016 | */ |
1000 | #define ELF_NOTE_TYPE_MARCH_TAG 5 | | 1017 | #define ELF_NOTE_TYPE_MARCH_TAG 5 |
1001 | /* NetBSD-specific note name and description sizes */ | | 1018 | /* NetBSD-specific note name and description sizes */ |
1002 | #define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ | | 1019 | #define ELF_NOTE_MARCH_NAMESZ ELF_NOTE_NETBSD_NAMESZ |
1003 | /* NetBSD-specific note name */ | | 1020 | /* NetBSD-specific note name */ |
1004 | #define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME | | 1021 | #define ELF_NOTE_MARCH_NAME ELF_NOTE_NETBSD_NAME |
1005 | | | 1022 | |
1006 | /* | | 1023 | /* |
1007 | * NetBSD-specific note type: MCMODEL | | 1024 | * NetBSD-specific note type: MCMODEL |
1008 | * There should be 1 NOTE per executable. | | 1025 | * There should be 1 NOTE per executable. |
1009 | * name: NetBSD\0 | | 1026 | * name: NetBSD\0 |
1010 | * namesz: 7 | | 1027 | * namesz: 7 |
1011 | * code model: string | | 1028 | * code model: string |
1012 | */ | | 1029 | */ |
1013 | | | 1030 | |
1014 | #define ELF_NOTE_TYPE_MCMODEL_TAG 6 | | 1031 | #define ELF_NOTE_TYPE_MCMODEL_TAG 6 |
1015 | /* NetBSD-specific note name and description sizes */ | | 1032 | /* NetBSD-specific note name and description sizes */ |
1016 | #define ELF_NOTE_MCMODEL_NAMESZ ELF_NOTE_NETBSD_NAMESZ | | 1033 | #define ELF_NOTE_MCMODEL_NAMESZ ELF_NOTE_NETBSD_NAMESZ |
1017 | /* NetBSD-specific note name */ | | 1034 | /* NetBSD-specific note name */ |
1018 | #define ELF_NOTE_MCMODEL_NAME ELF_NOTE_NETBSD_NAME | | 1035 | #define ELF_NOTE_MCMODEL_NAME ELF_NOTE_NETBSD_NAME |
1019 | | | 1036 | |
1020 | | | 1037 | |
1021 | #if !defined(ELFSIZE) && defined(ARCH_ELFSIZE) | | 1038 | #if !defined(ELFSIZE) && defined(ARCH_ELFSIZE) |
1022 | #define ELFSIZE ARCH_ELFSIZE | | 1039 | #define ELFSIZE ARCH_ELFSIZE |
1023 | #endif | | 1040 | #endif |
1024 | | | 1041 | |
1025 | #if defined(ELFSIZE) | | 1042 | #if defined(ELFSIZE) |
1026 | #define CONCAT(x,y) __CONCAT(x,y) | | 1043 | #define CONCAT(x,y) __CONCAT(x,y) |
1027 | #define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) | | 1044 | #define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x))) |
1028 | #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) | | 1045 | #define ELFNAME2(x,y) CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y)))) |
1029 | #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) | | 1046 | #define ELFNAMEEND(x) CONCAT(x,CONCAT(_elf,ELFSIZE)) |
1030 | #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) | | 1047 | #define ELFDEFNNAME(x) CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x))) |
1031 | #endif | | 1048 | #endif |
1032 | | | 1049 | |
1033 | #if defined(ELFSIZE) && (ELFSIZE == 32) | | 1050 | #if defined(ELFSIZE) && (ELFSIZE == 32) |
1034 | #define Elf_Ehdr Elf32_Ehdr | | 1051 | #define Elf_Ehdr Elf32_Ehdr |
1035 | #define Elf_Phdr Elf32_Phdr | | 1052 | #define Elf_Phdr Elf32_Phdr |
1036 | #define Elf_Shdr Elf32_Shdr | | 1053 | #define Elf_Shdr Elf32_Shdr |
1037 | #define Elf_Sym Elf32_Sym | | 1054 | #define Elf_Sym Elf32_Sym |
1038 | #define Elf_Rel Elf32_Rel | | 1055 | #define Elf_Rel Elf32_Rel |
1039 | #define Elf_Rela Elf32_Rela | | 1056 | #define Elf_Rela Elf32_Rela |
1040 | #define Elf_Dyn Elf32_Dyn | | 1057 | #define Elf_Dyn Elf32_Dyn |
1041 | #define Elf_Word Elf32_Word | | 1058 | #define Elf_Word Elf32_Word |
1042 | #define Elf_Sword Elf32_Sword | | 1059 | #define Elf_Sword Elf32_Sword |
1043 | #define Elf_Half Elf32_Half | | 1060 | #define Elf_Half Elf32_Half |
1044 | #define Elf_Addr Elf32_Addr | | 1061 | #define Elf_Addr Elf32_Addr |
1045 | #define Elf_Off Elf32_Off | | 1062 | #define Elf_Off Elf32_Off |
1046 | #define Elf_SOff Elf32_SOff | | 1063 | #define Elf_SOff Elf32_SOff |
1047 | #define Elf_Nhdr Elf32_Nhdr | | 1064 | #define Elf_Nhdr Elf32_Nhdr |
1048 | #define Elf_Verdef Elf32_Verdef | | 1065 | #define Elf_Verdef Elf32_Verdef |
1049 | #define Elf_Verdaux Elf32_Verdaux | | 1066 | #define Elf_Verdaux Elf32_Verdaux |
1050 | #define Elf_Verneed Elf32_Verneed | | 1067 | #define Elf_Verneed Elf32_Verneed |
1051 | #define Elf_Vernaux Elf32_Vernaux | | 1068 | #define Elf_Vernaux Elf32_Vernaux |
1052 | #define Elf_Versym Elf32_Versym | | 1069 | #define Elf_Versym Elf32_Versym |
1053 | | | 1070 | |
1054 | #define ELF_R_SYM ELF32_R_SYM | | 1071 | #define ELF_R_SYM ELF32_R_SYM |
1055 | #define ELF_R_TYPE ELF32_R_TYPE | | 1072 | #define ELF_R_TYPE ELF32_R_TYPE |
1056 | #define ELFCLASS ELFCLASS32 | | 1073 | #define ELFCLASS ELFCLASS32 |
1057 | | | 1074 | |
1058 | #define AuxInfo Aux32Info | | 1075 | #define AuxInfo Aux32Info |
1059 | #elif defined(ELFSIZE) && (ELFSIZE == 64) | | 1076 | #elif defined(ELFSIZE) && (ELFSIZE == 64) |
1060 | #define Elf_Ehdr Elf64_Ehdr | | 1077 | #define Elf_Ehdr Elf64_Ehdr |
1061 | #define Elf_Phdr Elf64_Phdr | | 1078 | #define Elf_Phdr Elf64_Phdr |
1062 | #define Elf_Shdr Elf64_Shdr | | 1079 | #define Elf_Shdr Elf64_Shdr |
1063 | #define Elf_Sym Elf64_Sym | | 1080 | #define Elf_Sym Elf64_Sym |
1064 | #define Elf_Rel Elf64_Rel | | 1081 | #define Elf_Rel Elf64_Rel |
1065 | #define Elf_Rela Elf64_Rela | | 1082 | #define Elf_Rela Elf64_Rela |
1066 | #define Elf_Dyn Elf64_Dyn | | 1083 | #define Elf_Dyn Elf64_Dyn |
1067 | #define Elf_Word Elf64_Word | | 1084 | #define Elf_Word Elf64_Word |
1068 | #define Elf_Sword Elf64_Sword | | 1085 | #define Elf_Sword Elf64_Sword |
1069 | #define Elf_Half Elf64_Half | | 1086 | #define Elf_Half Elf64_Half |
1070 | #define Elf_Addr Elf64_Addr | | 1087 | #define Elf_Addr Elf64_Addr |
1071 | #define Elf_Off Elf64_Off | | 1088 | #define Elf_Off Elf64_Off |
1072 | #define Elf_SOff Elf64_SOff | | 1089 | #define Elf_SOff Elf64_SOff |
1073 | #define Elf_Nhdr Elf64_Nhdr | | 1090 | #define Elf_Nhdr Elf64_Nhdr |
1074 | #define Elf_Verdef Elf64_Verdef | | 1091 | #define Elf_Verdef Elf64_Verdef |
1075 | #define Elf_Verdaux Elf64_Verdaux | | 1092 | #define Elf_Verdaux Elf64_Verdaux |
1076 | #define Elf_Verneed Elf64_Verneed | | 1093 | #define Elf_Verneed Elf64_Verneed |
1077 | #define Elf_Vernaux Elf64_Vernaux | | 1094 | #define Elf_Vernaux Elf64_Vernaux |
1078 | #define Elf_Versym Elf64_Versym | | 1095 | #define Elf_Versym Elf64_Versym |
1079 | | | 1096 | |
1080 | #define ELF_R_SYM ELF64_R_SYM | | 1097 | #define ELF_R_SYM ELF64_R_SYM |
1081 | #define ELF_R_TYPE ELF64_R_TYPE | | 1098 | #define ELF_R_TYPE ELF64_R_TYPE |
1082 | #define ELFCLASS ELFCLASS64 | | 1099 | #define ELFCLASS ELFCLASS64 |
1083 | | | 1100 | |
1084 | #define AuxInfo Aux64Info | | 1101 | #define AuxInfo Aux64Info |
1085 | #endif | | 1102 | #endif |
1086 | | | 1103 | |
1087 | #ifndef Elf_Symindx | | 1104 | #ifndef Elf_Symindx |
1088 | #define Elf_Symindx uint32_t | | 1105 | #define Elf_Symindx uint32_t |
1089 | #endif | | 1106 | #endif |
1090 | | | 1107 | |
1091 | #define ELF32_ST_BIND(info) ELF_ST_BIND(info) | | 1108 | #define ELF32_ST_BIND(info) ELF_ST_BIND(info) |
1092 | #define ELF32_ST_TYPE(info) ELF_ST_TYPE(info) | | 1109 | #define ELF32_ST_TYPE(info) ELF_ST_TYPE(info) |
1093 | #define ELF32_ST_INFO(bind,type) ELF_ST_INFO(bind,type) | | 1110 | #define ELF32_ST_INFO(bind,type) ELF_ST_INFO(bind,type) |
1094 | #define ELF32_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) | | 1111 | #define ELF32_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) |
1095 | | | 1112 | |
1096 | #define ELF64_ST_BIND(info) ELF_ST_BIND(info) | | 1113 | #define ELF64_ST_BIND(info) ELF_ST_BIND(info) |
1097 | #define ELF64_ST_TYPE(info) ELF_ST_TYPE(info) | | 1114 | #define ELF64_ST_TYPE(info) ELF_ST_TYPE(info) |
1098 | #define ELF64_ST_INFO(bind,type) ELF_ST_INFO(bind,type) | | 1115 | #define ELF64_ST_INFO(bind,type) ELF_ST_INFO(bind,type) |
1099 | #define ELF64_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) | | 1116 | #define ELF64_ST_VISIBILITY(other) ELF_ST_VISIBILITY(other) |
1100 | | | 1117 | |
1101 | typedef struct { | | 1118 | typedef struct { |
1102 | Elf32_Half si_boundto; /* direct bindings - symbol bound to */ | | 1119 | Elf32_Half si_boundto; /* direct bindings - symbol bound to */ |
1103 | Elf32_Half si_flags; /* per symbol flags */ | | 1120 | Elf32_Half si_flags; /* per symbol flags */ |
1104 | } Elf32_Syminfo; | | 1121 | } Elf32_Syminfo; |
1105 | | | 1122 | |
1106 | typedef struct { | | 1123 | typedef struct { |
1107 | Elf64_Word si_boundto; /* direct bindings - symbol bound to */ | | 1124 | Elf64_Word si_boundto; /* direct bindings - symbol bound to */ |
1108 | Elf64_Word si_flags; /* per symbol flags */ | | 1125 | Elf64_Word si_flags; /* per symbol flags */ |
1109 | } Elf64_Syminfo; | | 1126 | } Elf64_Syminfo; |
1110 | | | 1127 | |
1111 | #define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association | | 1128 | #define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association |
1112 | to object containing definition */ | | 1129 | to object containing definition */ |
1113 | #define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ | | 1130 | #define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */ |
1114 | #define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ | | 1131 | #define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */ |
1115 | #define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be | | 1132 | #define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be |
1116 | lazily-loaded */ | | 1133 | lazily-loaded */ |
1117 | #define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to | | 1134 | #define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to |
1118 | object containing definition */ | | 1135 | object containing definition */ |
1119 | #define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference | | 1136 | #define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference |
1120 | directly bind to this symbol */ | | 1137 | directly bind to this symbol */ |
1121 | #define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ | | 1138 | #define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */ |
1122 | #define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ | | 1139 | #define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */ |
1123 | | | 1140 | |
1124 | #define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ | | 1141 | #define SYMINFO_BT_SELF 0xffff /* symbol bound to self */ |
1125 | #define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ | | 1142 | #define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */ |
1126 | #define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ | | 1143 | #define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */ |
1127 | #define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ | | 1144 | #define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */ |
1128 | #define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ | | 1145 | #define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */ |
1129 | | | 1146 | |
1130 | #define SYMINFO_NONE 0 /* Syminfo version */ | | 1147 | #define SYMINFO_NONE 0 /* Syminfo version */ |
1131 | #define SYMINFO_CURRENT 1 | | 1148 | #define SYMINFO_CURRENT 1 |
1132 | #define SYMINFO_NUM 2 | | 1149 | #define SYMINFO_NUM 2 |
1133 | | | 1150 | |
1134 | /* | | 1151 | /* |
1135 | * These constants are used for Elf32_Verdef struct's version number. | | 1152 | * These constants are used for Elf32_Verdef struct's version number. |
1136 | */ | | 1153 | */ |
1137 | #define VER_DEF_NONE 0 | | 1154 | #define VER_DEF_NONE 0 |
1138 | #define VER_DEF_CURRENT 1 | | 1155 | #define VER_DEF_CURRENT 1 |
1139 | | | 1156 | |
1140 | /* | | 1157 | /* |
1141 | * These constants are used for Elf32_Verdef struct's vd_ndx. | | 1158 | * These constants are used for Elf32_Verdef struct's vd_ndx. |
1142 | */ | | 1159 | */ |
1143 | #define VER_DEF_IDX(x) VER_NDX(x) | | 1160 | #define VER_DEF_IDX(x) VER_NDX(x) |
1144 | | | 1161 | |
1145 | /* | | 1162 | /* |
1146 | * These constants are used for Elf32_Verdef struct's vd_flags. | | 1163 | * These constants are used for Elf32_Verdef struct's vd_flags. |
1147 | */ | | 1164 | */ |
1148 | #define VER_FLG_BASE 0x1 | | 1165 | #define VER_FLG_BASE 0x1 |
1149 | #define VER_FLG_WEAK 0x2 | | 1166 | #define VER_FLG_WEAK 0x2 |
1150 | | | 1167 | |
1151 | /* | | 1168 | /* |
1152 | * These are used in an Elf32_Versym field. | | 1169 | * These are used in an Elf32_Versym field. |
1153 | */ | | 1170 | */ |
1154 | #define VER_NDX_LOCAL 0 | | 1171 | #define VER_NDX_LOCAL 0 |
1155 | #define VER_NDX_GLOBAL 1 | | 1172 | #define VER_NDX_GLOBAL 1 |
1156 | #define VER_NDX_GIVEN 2 | | 1173 | #define VER_NDX_GIVEN 2 |
1157 | | | 1174 | |
1158 | /* | | 1175 | /* |
1159 | * These constants are used for Elf32_Verneed struct's version number. | | 1176 | * These constants are used for Elf32_Verneed struct's version number. |
1160 | */ | | 1177 | */ |
1161 | #define VER_NEED_NONE 0 | | 1178 | #define VER_NEED_NONE 0 |
1162 | #define VER_NEED_CURRENT 1 | | 1179 | #define VER_NEED_CURRENT 1 |
1163 | | | 1180 | |
1164 | /* | | 1181 | /* |
1165 | * These constants are used for Elf32_Vernaux struct's vna_other. | | 1182 | * These constants are used for Elf32_Vernaux struct's vna_other. |
1166 | */ | | 1183 | */ |
1167 | #define VER_NEED_HIDDEN VER_NDX_HIDDEN | | 1184 | #define VER_NEED_HIDDEN VER_NDX_HIDDEN |
1168 | #define VER_NEED_IDX(x) VER_NDX(x) | | 1185 | #define VER_NEED_IDX(x) VER_NDX(x) |
1169 | | | 1186 | |
1170 | /* index */ | | 1187 | /* index */ |
1171 | #define VER_NDX_HIDDEN 0x8000 | | 1188 | #define VER_NDX_HIDDEN 0x8000 |
1172 | #define VER_NDX(x) ((x) & ~VER_NDX_HIDDEN) | | 1189 | #define VER_NDX(x) ((x) & ~VER_NDX_HIDDEN) |
1173 | | | 1190 | |
1174 | /* | | 1191 | /* |
1175 | * GNU Extension hidding symbol | | 1192 | * GNU Extension hidding symbol |
1176 | */ | | 1193 | */ |
1177 | #define VERSYM_HIDDEN 0x8000 | | 1194 | #define VERSYM_HIDDEN 0x8000 |
1178 | #define VERSYM_VERSION 0x7fff | | 1195 | #define VERSYM_VERSION 0x7fff |
1179 | | | 1196 | |
1180 | #define ELF_VER_CHR '@' | | 1197 | #define ELF_VER_CHR '@' |
1181 | | | 1198 | |
1182 | /* | | 1199 | /* |
1183 | * These are current size independent. | | 1200 | * These are current size independent. |
1184 | */ | | 1201 | */ |
1185 | | | 1202 | |
1186 | typedef struct { | | 1203 | typedef struct { |
1187 | Elf32_Half vd_version; /* version number of structure */ | | 1204 | Elf32_Half vd_version; /* version number of structure */ |
1188 | Elf32_Half vd_flags; /* flags (VER_FLG_*) */ | | 1205 | Elf32_Half vd_flags; /* flags (VER_FLG_*) */ |
1189 | Elf32_Half vd_ndx; /* version index */ | | 1206 | Elf32_Half vd_ndx; /* version index */ |
1190 | Elf32_Half vd_cnt; /* number of verdaux entries */ | | 1207 | Elf32_Half vd_cnt; /* number of verdaux entries */ |
1191 | Elf32_Word vd_hash; /* hash of name */ | | 1208 | Elf32_Word vd_hash; /* hash of name */ |
1192 | Elf32_Word vd_aux; /* offset to verdaux entries */ | | 1209 | Elf32_Word vd_aux; /* offset to verdaux entries */ |
1193 | Elf32_Word vd_next; /* offset to next verdef */ | | 1210 | Elf32_Word vd_next; /* offset to next verdef */ |
1194 | } Elf32_Verdef; | | 1211 | } Elf32_Verdef; |
1195 | typedef Elf32_Verdef Elf64_Verdef; | | 1212 | typedef Elf32_Verdef Elf64_Verdef; |
1196 | | | 1213 | |
1197 | typedef struct { | | 1214 | typedef struct { |
1198 | Elf32_Word vda_name; /* string table offset of name */ | | 1215 | Elf32_Word vda_name; /* string table offset of name */ |
1199 | Elf32_Word vda_next; /* offset to verdaux */ | | 1216 | Elf32_Word vda_next; /* offset to verdaux */ |
1200 | } Elf32_Verdaux; | | 1217 | } Elf32_Verdaux; |
1201 | typedef Elf32_Verdaux Elf64_Verdaux; | | 1218 | typedef Elf32_Verdaux Elf64_Verdaux; |
1202 | | | 1219 | |
1203 | typedef struct { | | 1220 | typedef struct { |
1204 | Elf32_Half vn_version; /* version number of structure */ | | 1221 | Elf32_Half vn_version; /* version number of structure */ |
1205 | Elf32_Half vn_cnt; /* number of vernaux entries */ | | 1222 | Elf32_Half vn_cnt; /* number of vernaux entries */ |
1206 | Elf32_Word vn_file; /* string table offset of library name*/ | | 1223 | Elf32_Word vn_file; /* string table offset of library name*/ |
1207 | Elf32_Word vn_aux; /* offset to vernaux entries */ | | 1224 | Elf32_Word vn_aux; /* offset to vernaux entries */ |
1208 | Elf32_Word vn_next; /* offset to next verneed */ | | 1225 | Elf32_Word vn_next; /* offset to next verneed */ |
1209 | } Elf32_Verneed; | | 1226 | } Elf32_Verneed; |
1210 | typedef Elf32_Verneed Elf64_Verneed; | | 1227 | typedef Elf32_Verneed Elf64_Verneed; |
1211 | | | 1228 | |
1212 | typedef struct { | | 1229 | typedef struct { |
1213 | Elf32_Word vna_hash; /* Hash of dependency name */ | | 1230 | Elf32_Word vna_hash; /* Hash of dependency name */ |
1214 | Elf32_Half vna_flags; /* flags (VER_FLG_*) */ | | 1231 | Elf32_Half vna_flags; /* flags (VER_FLG_*) */ |
1215 | Elf32_Half vna_other; /* unused */ | | 1232 | Elf32_Half vna_other; /* unused */ |
1216 | Elf32_Word vna_name; /* string table offset to version name*/ | | 1233 | Elf32_Word vna_name; /* string table offset to version name*/ |
1217 | Elf32_Word vna_next; /* offset to next vernaux */ | | 1234 | Elf32_Word vna_next; /* offset to next vernaux */ |
1218 | } Elf32_Vernaux; | | 1235 | } Elf32_Vernaux; |
1219 | typedef Elf32_Vernaux Elf64_Vernaux; | | 1236 | typedef Elf32_Vernaux Elf64_Vernaux; |
1220 | | | 1237 | |
1221 | typedef struct { | | 1238 | typedef struct { |
1222 | Elf32_Half vs_vers; | | 1239 | Elf32_Half vs_vers; |
1223 | } Elf32_Versym; | | 1240 | } Elf32_Versym; |
1224 | typedef Elf32_Versym Elf64_Versym; | | 1241 | typedef Elf32_Versym Elf64_Versym; |
1225 | | | 1242 | |
1226 | #ifdef _KERNEL | | 1243 | #ifdef _KERNEL |
1227 | | | 1244 | |
1228 | /* | | 1245 | /* |
1229 | * Arbitrary limits to avoid DoS for excessive memory allocation. | | 1246 | * Arbitrary limits to avoid DoS for excessive memory allocation. |
1230 | */ | | 1247 | */ |
1231 | #define ELF_MAXPHNUM 128 | | 1248 | #define ELF_MAXPHNUM 128 |
1232 | #define ELF_MAXSHNUM 32768 | | 1249 | #define ELF_MAXSHNUM 32768 |
1233 | #define ELF_MAXNOTESIZE 1024 | | 1250 | #define ELF_MAXNOTESIZE 1024 |
1234 | | | 1251 | |
1235 | #define ELF_AUX_ENTRIES 15 /* Max size of aux array passed to loader */ | | 1252 | #define ELF_AUX_ENTRIES 15 /* Max size of aux array passed to loader */ |
1236 | #define ELF32_NO_ADDR (~(Elf32_Addr)0) /* Indicates addr. not yet filled in */ | | 1253 | #define ELF32_NO_ADDR (~(Elf32_Addr)0) /* Indicates addr. not yet filled in */ |
1237 | #define ELF32_LINK_ADDR ((Elf32_Addr)-2) /* advises to use link address */ | | 1254 | #define ELF32_LINK_ADDR ((Elf32_Addr)-2) /* advises to use link address */ |
1238 | #define ELF64_NO_ADDR (~(Elf64_Addr)0) /* Indicates addr. not yet filled in */ | | 1255 | #define ELF64_NO_ADDR (~(Elf64_Addr)0) /* Indicates addr. not yet filled in */ |
1239 | #define ELF64_LINK_ADDR ((Elf64_Addr)-2) /* advises to use link address */ | | 1256 | #define ELF64_LINK_ADDR ((Elf64_Addr)-2) /* advises to use link address */ |
1240 | | | 1257 | |
1241 | #if defined(ELFSIZE) && (ELFSIZE == 64) | | 1258 | #if defined(ELFSIZE) && (ELFSIZE == 64) |
1242 | #define ELF_NO_ADDR ELF64_NO_ADDR | | 1259 | #define ELF_NO_ADDR ELF64_NO_ADDR |
1243 | #define ELF_LINK_ADDR ELF64_LINK_ADDR | | 1260 | #define ELF_LINK_ADDR ELF64_LINK_ADDR |
1244 | #elif defined(ELFSIZE) && (ELFSIZE == 32) | | 1261 | #elif defined(ELFSIZE) && (ELFSIZE == 32) |
1245 | #define ELF_NO_ADDR ELF32_NO_ADDR | | 1262 | #define ELF_NO_ADDR ELF32_NO_ADDR |
1246 | #define ELF_LINK_ADDR ELF32_LINK_ADDR | | 1263 | #define ELF_LINK_ADDR ELF32_LINK_ADDR |
1247 | #endif | | 1264 | #endif |
1248 | | | 1265 | |
1249 | #ifndef ELF32_EHDR_FLAGS_OK | | 1266 | #ifndef ELF32_EHDR_FLAGS_OK |
1250 | #define ELF32_EHDR_FLAGS_OK(eh) 1 | | 1267 | #define ELF32_EHDR_FLAGS_OK(eh) 1 |
1251 | #endif | | 1268 | #endif |
1252 | | | 1269 | |
1253 | #ifndef ELF64_EHDR_FLAGS_OK | | 1270 | #ifndef ELF64_EHDR_FLAGS_OK |
1254 | #define ELF64_EHDR_FLAGS_OK(eh) 1 | | 1271 | #define ELF64_EHDR_FLAGS_OK(eh) 1 |
1255 | #endif | | 1272 | #endif |
1256 | | | 1273 | |
1257 | #if defined(ELFSIZE) && (ELFSIZE == 64) | | 1274 | #if defined(ELFSIZE) && (ELFSIZE == 64) |
1258 | #define ELF_EHDR_FLAGS_OK(eh) ELF64_EHDR_FLAGS_OK(eh) | | 1275 | #define ELF_EHDR_FLAGS_OK(eh) ELF64_EHDR_FLAGS_OK(eh) |
1259 | #else | | 1276 | #else |
1260 | #define ELF_EHDR_FLAGS_OK(eh) ELF32_EHDR_FLAGS_OK(eh) | | 1277 | #define ELF_EHDR_FLAGS_OK(eh) ELF32_EHDR_FLAGS_OK(eh) |
1261 | #endif | | 1278 | #endif |
1262 | | | 1279 | |
1263 | #if defined(ELFSIZE) | | 1280 | #if defined(ELFSIZE) |
1264 | struct elf_args { | | 1281 | struct elf_args { |
1265 | Elf_Addr arg_entry; /* program entry point */ | | 1282 | Elf_Addr arg_entry; /* program entry point */ |
1266 | Elf_Addr arg_interp; /* Interpreter load address */ | | 1283 | Elf_Addr arg_interp; /* Interpreter load address */ |
1267 | Elf_Addr arg_phaddr; /* program header address */ | | 1284 | Elf_Addr arg_phaddr; /* program header address */ |
1268 | Elf_Addr arg_phentsize; /* Size of program header */ | | 1285 | Elf_Addr arg_phentsize; /* Size of program header */ |
1269 | Elf_Addr arg_phnum; /* Number of program headers */ | | 1286 | Elf_Addr arg_phnum; /* Number of program headers */ |
1270 | }; | | 1287 | }; |
1271 | #endif | | 1288 | #endif |
1272 | | | 1289 | |
1273 | #ifdef _KERNEL_OPT | | 1290 | #ifdef _KERNEL_OPT |
1274 | #include "opt_execfmt.h" | | 1291 | #include "opt_execfmt.h" |
1275 | #endif | | 1292 | #endif |
1276 | | | 1293 | |
1277 | struct ps_strings; | | 1294 | struct ps_strings; |
1278 | struct coredump_iostate; | | 1295 | struct coredump_iostate; |
1279 | struct note_state; | | 1296 | struct note_state; |
1280 | | | 1297 | |
1281 | #ifdef EXEC_ELF32 | | 1298 | #ifdef EXEC_ELF32 |
1282 | int exec_elf32_makecmds(struct lwp *, struct exec_package *); | | 1299 | int exec_elf32_makecmds(struct lwp *, struct exec_package *); |
1283 | int elf32_copyargs(struct lwp *, struct exec_package *, | | 1300 | int elf32_copyargs(struct lwp *, struct exec_package *, |
1284 | struct ps_strings *, char **, void *); | | 1301 | struct ps_strings *, char **, void *); |
1285 | | | 1302 | |
1286 | int coredump_elf32(struct lwp *, struct coredump_iostate *); | | 1303 | int coredump_elf32(struct lwp *, struct coredump_iostate *); |
1287 | void coredump_savenote_elf32(struct note_state *, unsigned int, | | 1304 | void coredump_savenote_elf32(struct note_state *, unsigned int, |
1288 | const char *, void *, size_t); | | 1305 | const char *, void *, size_t); |
1289 | | | 1306 | |
1290 | int elf32_check_header(Elf32_Ehdr *); | | 1307 | int elf32_check_header(Elf32_Ehdr *); |
1291 | #endif | | 1308 | #endif |
1292 | | | 1309 | |
1293 | #ifdef EXEC_ELF64 | | 1310 | #ifdef EXEC_ELF64 |
1294 | int exec_elf64_makecmds(struct lwp *, struct exec_package *); | | 1311 | int exec_elf64_makecmds(struct lwp *, struct exec_package *); |
1295 | int elf64_copyargs(struct lwp *, struct exec_package *, | | 1312 | int elf64_copyargs(struct lwp *, struct exec_package *, |
1296 | struct ps_strings *, char **, void *); | | 1313 | struct ps_strings *, char **, void *); |
1297 | | | 1314 | |
1298 | int coredump_elf64(struct lwp *, struct coredump_iostate *); | | 1315 | int coredump_elf64(struct lwp *, struct coredump_iostate *); |
1299 | void coredump_savenote_elf64(struct note_state *, unsigned int, | | 1316 | void coredump_savenote_elf64(struct note_state *, unsigned int, |
1300 | const char *, void *, size_t); | | 1317 | const char *, void *, size_t); |
1301 | | | 1318 | |
1302 | int elf64_check_header(Elf64_Ehdr *); | | 1319 | int elf64_check_header(Elf64_Ehdr *); |
1303 | #endif | | 1320 | #endif |
1304 | | | 1321 | |
1305 | #endif /* _KERNEL */ | | 1322 | #endif /* _KERNEL */ |
1306 | | | 1323 | |
1307 | #endif /* !_SYS_EXEC_ELF_H_ */ | | 1324 | #endif /* !_SYS_EXEC_ELF_H_ */ |