Print this page
10366 ld(1) should support GNU-style linker sets
10581 ld(1) should know kernel modules are a thing
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/link.h
+++ new/usr/src/uts/common/sys/link.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1988 AT&T
24 24 * All Rights Reserved
25 25 *
26 26 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
27 27 *
28 28 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
29 29 */
30 30
31 31 #ifndef _SYS_LINK_H
32 32 #define _SYS_LINK_H
33 33
34 34 #ifndef _ASM
35 35 #include <sys/types.h>
36 36 #include <sys/elftypes.h>
37 37 #endif
38 38
39 39 #ifdef __cplusplus
40 40 extern "C" {
41 41 #endif
42 42
43 43 /*
44 44 * Communication structures for the runtime linker.
45 45 */
46 46
47 47 /*
48 48 * The following data structure provides a self-identifying union consisting
49 49 * of a tag from a known list and a value.
50 50 */
51 51 #ifndef _ASM
52 52 typedef struct {
53 53 Elf32_Sword d_tag; /* how to interpret value */
54 54 union {
55 55 Elf32_Word d_val;
56 56 Elf32_Addr d_ptr;
57 57 Elf32_Off d_off;
58 58 } d_un;
59 59 } Elf32_Dyn;
60 60
61 61 #if defined(_LP64) || defined(_LONGLONG_TYPE)
62 62 typedef struct {
63 63 Elf64_Xword d_tag; /* how to interpret value */
64 64 union {
65 65 Elf64_Xword d_val;
66 66 Elf64_Addr d_ptr;
67 67 } d_un;
68 68 } Elf64_Dyn;
69 69 #endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
70 70 #endif /* _ASM */
71 71
72 72 /*
73 73 * Tag values
74 74 */
75 75 #define DT_NULL 0 /* last entry in list */
76 76 #define DT_NEEDED 1 /* a needed object */
77 77 #define DT_PLTRELSZ 2 /* size of relocations for the PLT */
78 78 #define DT_PLTGOT 3 /* addresses used by procedure linkage table */
79 79 #define DT_HASH 4 /* hash table */
80 80 #define DT_STRTAB 5 /* string table */
81 81 #define DT_SYMTAB 6 /* symbol table */
82 82 #define DT_RELA 7 /* addr of relocation entries */
83 83 #define DT_RELASZ 8 /* size of relocation table */
84 84 #define DT_RELAENT 9 /* base size of relocation entry */
85 85 #define DT_STRSZ 10 /* size of string table */
86 86 #define DT_SYMENT 11 /* size of symbol table entry */
87 87 #define DT_INIT 12 /* _init addr */
88 88 #define DT_FINI 13 /* _fini addr */
89 89 #define DT_SONAME 14 /* name of this shared object */
90 90 #define DT_RPATH 15 /* run-time search path */
91 91 #define DT_SYMBOLIC 16 /* shared object linked -Bsymbolic */
92 92 #define DT_REL 17 /* addr of relocation entries */
93 93 #define DT_RELSZ 18 /* size of relocation table */
94 94 #define DT_RELENT 19 /* base size of relocation entry */
95 95 #define DT_PLTREL 20 /* relocation type for PLT entry */
96 96 #define DT_DEBUG 21 /* pointer to r_debug structure */
97 97 #define DT_TEXTREL 22 /* text relocations remain for this object */
98 98 #define DT_JMPREL 23 /* pointer to the PLT relocation entries */
99 99 #define DT_BIND_NOW 24 /* perform all relocations at load of object */
100 100 #define DT_INIT_ARRAY 25 /* pointer to .init_array */
101 101 #define DT_FINI_ARRAY 26 /* pointer to .fini_array */
102 102 #define DT_INIT_ARRAYSZ 27 /* size of .init_array */
103 103 #define DT_FINI_ARRAYSZ 28 /* size of .fini_array */
104 104 #define DT_RUNPATH 29 /* run-time search path */
105 105 #define DT_FLAGS 30 /* state flags - see DF_* */
106 106
107 107 /*
108 108 * DT_* encoding rules: The value of each dynamic tag determines the
109 109 * interpretation of the d_un union. This convention provides for simpler
110 110 * interpretation of dynamic tags by external tools. A tag whose value
111 111 * is an even number indicates a dynamic section entry that uses d_ptr.
112 112 * A tag whose value is an odd number indicates a dynamic section entry
113 113 * that uses d_val, or that uses neither d_ptr nor d_val.
114 114 *
115 115 * There are exceptions to the above rule:
116 116 * - Tags with values that are less than DT_ENCODING.
117 117 * - Tags with values that fall between DT_LOOS and DT_SUNW_ENCODING
118 118 * - Tags with values that fall between DT_HIOS and DT_LOPROC
119 119 *
120 120 * Third party tools must handle these exception ranges explicitly
121 121 * on an item by item basis.
122 122 */
123 123 #define DT_ENCODING 32 /* positive tag DT_* encoding rules */
124 124 /* start after this */
125 125 #define DT_PREINIT_ARRAY 32 /* pointer to .preinit_array */
126 126 #define DT_PREINIT_ARRAYSZ 33 /* size of .preinit_array */
127 127
128 128 #define DT_MAXPOSTAGS 34 /* number of positive tags */
129 129
130 130 /*
131 131 * DT_* encoding rules do not apply between DT_LOOS and DT_SUNW_ENCODING
132 132 */
133 133 #define DT_LOOS 0x6000000d /* OS specific range */
134 134 #define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */
135 135 #define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */
136 136 #define DT_SUNW_FILTER 0x6000000f /* symbol filter name */
137 137 #define DT_SUNW_CAP 0x60000010 /* hardware/software */
138 138 /* capabilities */
139 139 #define DT_SUNW_SYMTAB 0x60000011 /* symtab with local fcn */
140 140 /* symbols immediately */
141 141 /* preceding DT_SYMTAB */
142 142 #define DT_SUNW_SYMSZ 0x60000012 /* Size of SUNW_SYMTAB table */
143 143
144 144 /*
145 145 * DT_* encoding rules apply between DT_SUNW_ENCODING and DT_HIOS
146 146 */
147 147 #define DT_SUNW_ENCODING 0x60000013 /* DT_* encoding rules resume */
148 148 /* after this */
149 149 #define DT_SUNW_SORTENT 0x60000013 /* sizeof [SYM|TLS]SORT entry */
150 150 #define DT_SUNW_SYMSORT 0x60000014 /* sym indices sorted by addr */
151 151 #define DT_SUNW_SYMSORTSZ 0x60000015 /* size of SUNW_SYMSORT */
152 152 #define DT_SUNW_TLSSORT 0x60000016 /* tls sym ndx sort by offset */
153 153 #define DT_SUNW_TLSSORTSZ 0x60000017 /* size of SUNW_TLSSORT */
↓ open down ↓ |
153 lines elided |
↑ open up ↑ |
154 154 #define DT_SUNW_CAPINFO 0x60000018 /* capabilities symbols */
155 155 #define DT_SUNW_STRPAD 0x60000019 /* # of unused bytes at the */
156 156 /* end of dynstr */
157 157 #define DT_SUNW_CAPCHAIN 0x6000001a /* capabilities chain info */
158 158 #define DT_SUNW_LDMACH 0x6000001b /* EM_ machine code of linker */
159 159 /* that produced object */
160 160 #define DT_SUNW_CAPCHAINENT 0x6000001d /* capabilities chain entry */
161 161 #define DT_SUNW_CAPCHAINSZ 0x6000001f /* capabilities chain size */
162 162 /* 0x60000021 would be DT_SUNW_PARENT */
163 163 #define DT_SUNW_ASLR 0x60000023 /* executable ASLR desire */
164 +#define DT_SUNW_KMOD 0x60000027 /* object is a kernel module */
164 165
165 166 /*
166 167 * DT_* encoding rules do not apply between DT_HIOS and DT_LOPROC
167 168 */
168 169 #define DT_HIOS 0x6ffff000
169 170
170 171 /*
171 172 * The following values have been deprecated and remain here to allow
172 173 * compatibility with older binaries.
173 174 */
174 175 #define DT_DEPRECATED_SPARC_REGISTER 0x7000001
175 176
176 177 /*
177 178 * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
178 179 * Dyn.d_un.d_val field of the Elf*_Dyn structure.
179 180 */
180 181 #define DT_VALRNGLO 0x6ffffd00
181 182
182 183 #define DT_GNU_PRELINKED 0x6ffffdf5 /* prelinking timestamp (unused) */
183 184 #define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* size of conflict section (unused) */
184 185 #define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* size of library list (unused) */
185 186 #define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */
186 187 #define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */
187 188 #define DT_MOVEENT 0x6ffffdfa /* move table entry size */
188 189 #define DT_MOVESZ 0x6ffffdfb /* move table size */
189 190 #define DT_FEATURE_1 0x6ffffdfc /* feature holder (unused) */
190 191 #define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */
191 192 /* the following DT_* entry. */
192 193 /* See DF_P1_* definitions */
193 194 #define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */
194 195 #define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */
195 196 #define DT_VALRNGHI 0x6ffffdff
196 197
197 198 /*
198 199 * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
199 200 * Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
200 201 *
201 202 * If any adjustment is made to the ELF object after it has been
202 203 * built, these entries will need to be adjusted.
203 204 */
204 205 #define DT_ADDRRNGLO 0x6ffffe00
205 206
206 207 #define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table (unused) */
207 208 #define DT_TLSDESC_PLT 0x6ffffef6 /* GNU (unused) */
208 209 #define DT_TLSDESC_GOT 0x6ffffef7 /* GNU (unused) */
209 210 #define DT_GNU_CONFLICT 0x6ffffef8 /* start of conflict section (unused) */
210 211 #define DT_GNU_LIBLIST 0x6ffffef9 /* Library list (unused) */
211 212
212 213 #define DT_CONFIG 0x6ffffefa /* configuration information */
213 214 #define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */
214 215 #define DT_AUDIT 0x6ffffefc /* object auditing */
215 216 #define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */
216 217 #define DT_MOVETAB 0x6ffffefe /* move table */
217 218 #define DT_SYMINFO 0x6ffffeff /* syminfo table */
218 219 #define DT_ADDRRNGHI 0x6ffffeff
219 220
220 221 /*
221 222 * The following DT_* entries should have been assigned within one of the
222 223 * DT_* ranges, but existed before such ranges had been established.
↓ open down ↓ |
49 lines elided |
↑ open up ↑ |
223 224 */
224 225 #define DT_VERSYM 0x6ffffff0 /* version symbol table - unused by */
225 226 /* Solaris (see libld/update.c) */
226 227
227 228 #define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */
228 229 #define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */
229 230 #define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */
230 231 #define DT_VERDEF 0x6ffffffc /* version definition table and */
231 232 #define DT_VERDEFNUM 0x6ffffffd /* associated no. of entries */
232 233 #define DT_VERNEED 0x6ffffffe /* version needed table and */
233 -#define DT_VERNEEDNUM 0x6fffffff /* associated no. of entries */
234 +#define DT_VERNEEDNUM 0x6fffffff /* associated no. of entries */
234 235
235 236 /*
236 237 * DT_* entries between DT_HIPROC and DT_LOPROC are reserved for processor
237 238 * specific semantics.
238 239 *
239 240 * DT_* encoding rules apply to all tag values larger than DT_LOPROC.
240 241 */
241 242 #define DT_LOPROC 0x70000000 /* processor specific range */
242 243 #define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
243 244 #define DT_USED 0x7ffffffe /* ignored - same as needed */
244 245 #define DT_FILTER 0x7fffffff /* shared library filter name */
245 246 #define DT_HIPROC 0x7fffffff
246 247
247 248
248 249 /*
249 250 * Values for DT_FLAGS
250 251 */
251 252 #define DF_ORIGIN 0x00000001 /* ORIGIN processing required */
252 253 #define DF_SYMBOLIC 0x00000002 /* symbolic bindings in effect */
253 254 #define DF_TEXTREL 0x00000004 /* text relocations remain */
254 255 #define DF_BIND_NOW 0x00000008 /* process all relocations */
255 256 #define DF_STATIC_TLS 0x00000010 /* obj. contains static TLS refs */
256 257
257 258 /*
258 259 * Values for the DT_POSFLAG_1 .dynamic entry.
259 260 * These values only affect the following DT_* entry.
260 261 */
261 262 #define DF_P1_LAZYLOAD 0x00000001 /* following object is to be */
262 263 /* lazy loaded */
263 264 #define DF_P1_GROUPPERM 0x00000002 /* following object's symbols are */
264 265 /* not available for general */
265 266 /* symbol bindings. */
266 267 #define DF_P1_DEFERRED 0x00000004 /* following object is deferred */
267 268
268 269 /*
269 270 * Values for the DT_FLAGS_1 .dynamic entry.
270 271 */
271 272 #define DF_1_NOW 0x00000001 /* set RTLD_NOW for this object */
272 273 #define DF_1_GLOBAL 0x00000002 /* set RTLD_GLOBAL for this object */
273 274 #define DF_1_GROUP 0x00000004 /* set RTLD_GROUP for this object */
274 275 #define DF_1_NODELETE 0x00000008 /* set RTLD_NODELETE for this object */
275 276 #define DF_1_LOADFLTR 0x00000010 /* trigger filtee loading at runtime */
276 277 #define DF_1_INITFIRST 0x00000020 /* set RTLD_INITFIRST for this object */
277 278 #define DF_1_NOOPEN 0x00000040 /* set RTLD_NOOPEN for this object */
278 279 #define DF_1_ORIGIN 0x00000080 /* ORIGIN processing required */
279 280 #define DF_1_DIRECT 0x00000100 /* direct binding enabled */
280 281 #define DF_1_TRANS 0x00000200 /* unused obsolete name */
281 282 #define DF_1_INTERPOSE 0x00000400 /* object is an interposer */
282 283 #define DF_1_NODEFLIB 0x00000800 /* ignore default library search path */
283 284 #define DF_1_NODUMP 0x00001000 /* object can't be dldump(3x)'ed */
284 285 #define DF_1_CONFALT 0x00002000 /* configuration alternative created */
285 286 #define DF_1_ENDFILTEE 0x00004000 /* filtee terminates filters search */
286 287 #define DF_1_DISPRELDNE 0x00008000 /* disp reloc applied at build time */
287 288 #define DF_1_DISPRELPND 0x00010000 /* disp reloc applied at run-time */
288 289 #define DF_1_NODIRECT 0x00020000 /* object contains symbols that */
289 290 /* cannot be directly bound to */
290 291 #define DF_1_IGNMULDEF 0x00040000 /* internal: krtld ignore muldefs */
291 292 #define DF_1_NOKSYMS 0x00080000 /* internal: don't export object's */
292 293 /* symbols via /dev/ksyms */
293 294 #define DF_1_NOHDR 0x00100000 /* mapfile: 1st segment mapping */
294 295 /* omits ELF & program headers */
295 296 #define DF_1_EDITED 0x00200000 /* object has been modified since */
296 297 /* being built by 'ld' */
297 298 #define DF_1_NORELOC 0x00400000 /* internal: unrelocated object */
298 299 #define DF_1_SYMINTPOSE 0x00800000 /* individual symbol interposers */
299 300 /* exist */
300 301 #define DF_1_GLOBAUDIT 0x01000000 /* establish global auditing */
301 302 #define DF_1_SINGLETON 0x02000000 /* singleton symbols exist */
302 303
303 304 /*
304 305 * Values set to DT_FEATURE_1 tag's d_val (unused obsolete tag)
305 306 */
306 307 #define DTF_1_PARINIT 0x00000001 /* partially initialization feature */
307 308 #define DTF_1_CONFEXP 0x00000002 /* configuration file expected */
308 309
309 310
310 311 /*
311 312 * Version structures. There are three types of version structure:
312 313 *
313 314 * o A definition of the versions within the image itself.
314 315 * Each version definition is assigned a unique index (starting from
315 316 * VER_NDX_BGNDEF) which is used to cross-reference symbols associated to
316 317 * the version. Each version can have one or more dependencies on other
317 318 * version definitions within the image. The version name, and any
318 319 * dependency names, are specified in the version definition auxiliary
319 320 * array. Version definition entries require a version symbol index table.
320 321 *
321 322 * o A version requirement on a needed dependency. Each needed entry
322 323 * specifies the shared object dependency (as specified in DT_NEEDED).
323 324 * One or more versions required from this dependency are specified in the
324 325 * version needed auxiliary array.
325 326 *
326 327 * o A version symbol index table. Each symbol indexes into this array
327 328 * to determine its version index. Index values of VER_NDX_BGNDEF or
328 329 * greater indicate the version definition to which a symbol is associated.
329 330 * (the size of a symbol index entry is recorded in the sh_info field).
330 331 */
331 332 #ifndef _ASM
332 333
333 334 typedef struct { /* Version Definition Structure. */
334 335 Elf32_Half vd_version; /* this structures version revision */
335 336 Elf32_Half vd_flags; /* version information */
336 337 Elf32_Half vd_ndx; /* version index */
337 338 Elf32_Half vd_cnt; /* no. of associated aux entries */
338 339 Elf32_Word vd_hash; /* version name hash value */
339 340 Elf32_Word vd_aux; /* no. of bytes from start of this */
340 341 /* verdef to verdaux array */
341 342 Elf32_Word vd_next; /* no. of bytes from start of this */
342 343 } Elf32_Verdef; /* verdef to next verdef entry */
343 344
344 345 typedef struct { /* Verdef Auxiliary Structure. */
345 346 Elf32_Word vda_name; /* first element defines the version */
346 347 /* name. Additional entries */
347 348 /* define dependency names. */
348 349 Elf32_Word vda_next; /* no. of bytes from start of this */
349 350 } Elf32_Verdaux; /* verdaux to next verdaux entry */
350 351
351 352
352 353 typedef struct { /* Version Requirement Structure. */
353 354 Elf32_Half vn_version; /* this structures version revision */
354 355 Elf32_Half vn_cnt; /* no. of associated aux entries */
355 356 Elf32_Word vn_file; /* name of needed dependency (file) */
356 357 Elf32_Word vn_aux; /* no. of bytes from start of this */
357 358 /* verneed to vernaux array */
358 359 Elf32_Word vn_next; /* no. of bytes from start of this */
↓ open down ↓ |
115 lines elided |
↑ open up ↑ |
359 360 } Elf32_Verneed; /* verneed to next verneed entry */
360 361
361 362 typedef struct { /* Verneed Auxiliary Structure. */
362 363 Elf32_Word vna_hash; /* version name hash value */
363 364 Elf32_Half vna_flags; /* version information */
364 365 Elf32_Half vna_other;
365 366 Elf32_Word vna_name; /* version name */
366 367 Elf32_Word vna_next; /* no. of bytes from start of this */
367 368 } Elf32_Vernaux; /* vernaux to next vernaux entry */
368 369
369 -typedef Elf32_Half Elf32_Versym; /* Version symbol index array */
370 +typedef Elf32_Half Elf32_Versym; /* Version symbol index array */
370 371
371 372 typedef struct {
372 373 Elf32_Half si_boundto; /* direct bindings - symbol bound to */
373 374 Elf32_Half si_flags; /* per symbol flags */
374 375 } Elf32_Syminfo;
375 376
376 377
377 378 #if defined(_LP64) || defined(_LONGLONG_TYPE)
378 379 typedef struct {
379 380 Elf64_Half vd_version; /* this structures version revision */
380 381 Elf64_Half vd_flags; /* version information */
381 382 Elf64_Half vd_ndx; /* version index */
382 383 Elf64_Half vd_cnt; /* no. of associated aux entries */
383 384 Elf64_Word vd_hash; /* version name hash value */
384 385 Elf64_Word vd_aux; /* no. of bytes from start of this */
385 386 /* verdef to verdaux array */
386 387 Elf64_Word vd_next; /* no. of bytes from start of this */
387 388 } Elf64_Verdef; /* verdef to next verdef entry */
388 389
389 390 typedef struct {
390 391 Elf64_Word vda_name; /* first element defines the version */
391 392 /* name. Additional entries */
392 393 /* define dependency names. */
393 394 Elf64_Word vda_next; /* no. of bytes from start of this */
394 395 } Elf64_Verdaux; /* verdaux to next verdaux entry */
395 396
396 397 typedef struct {
397 398 Elf64_Half vn_version; /* this structures version revision */
398 399 Elf64_Half vn_cnt; /* no. of associated aux entries */
399 400 Elf64_Word vn_file; /* name of needed dependency (file) */
400 401 Elf64_Word vn_aux; /* no. of bytes from start of this */
401 402 /* verneed to vernaux array */
402 403 Elf64_Word vn_next; /* no. of bytes from start of this */
403 404 } Elf64_Verneed; /* verneed to next verneed entry */
404 405
405 406 typedef struct {
406 407 Elf64_Word vna_hash; /* version name hash value */
407 408 Elf64_Half vna_flags; /* version information */
408 409 Elf64_Half vna_other;
409 410 Elf64_Word vna_name; /* version name */
410 411 Elf64_Word vna_next; /* no. of bytes from start of this */
411 412 } Elf64_Vernaux; /* vernaux to next vernaux entry */
412 413
413 414 typedef Elf64_Half Elf64_Versym;
414 415
415 416 typedef struct {
416 417 Elf64_Half si_boundto; /* direct bindings - symbol bound to */
417 418 Elf64_Half si_flags; /* per symbol flags */
418 419 } Elf64_Syminfo;
419 420 #endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
420 421
421 422 #endif /* _ASM */
422 423
423 424 /*
424 425 * Versym symbol index values. Values greater than VER_NDX_GLOBAL
425 426 * and less then VER_NDX_LORESERVE associate symbols with user
426 427 * specified version descriptors.
427 428 */
428 429 #define VER_NDX_LOCAL 0 /* symbol is local */
429 430 #define VER_NDX_GLOBAL 1 /* symbol is global and assigned to */
430 431 /* the base version */
431 432 #define VER_NDX_LORESERVE 0xff00 /* beginning of RESERVED entries */
432 433 #define VER_NDX_ELIMINATE 0xff01 /* symbol is to be eliminated */
433 434
434 435 /*
435 436 * Verdef (vd_flags) and Vernaux (vna_flags) flags values.
436 437 */
437 438 #define VER_FLG_BASE 0x1 /* version definition of file itself */
438 439 /* (Verdef only) */
439 440 #define VER_FLG_WEAK 0x2 /* weak version identifier */
440 441 #define VER_FLG_INFO 0x4 /* version is recorded in object for */
441 442 /* informational purposes */
442 443 /* (Versym reference) only. No */
443 444 /* runtime verification is */
444 445 /* required. (Vernaux only) */
445 446
446 447 /*
447 448 * Verdef version values.
448 449 */
449 450 #define VER_DEF_NONE 0 /* Ver_def version */
450 451 #define VER_DEF_CURRENT 1
451 452 #define VER_DEF_NUM 2
452 453
453 454 /*
454 455 * Verneed version values.
455 456 */
456 457 #define VER_NEED_NONE 0 /* Ver_need version */
↓ open down ↓ |
77 lines elided |
↑ open up ↑ |
457 458 #define VER_NEED_CURRENT 1
458 459 #define VER_NEED_NUM 2
459 460
460 461
461 462 /*
462 463 * Syminfo flag values
463 464 */
464 465 #define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */
465 466 /* to object containing defn. */
466 467 #define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */
467 - /* standard filter */
468 + /* standard filter */
468 469 #define SYMINFO_FLG_PASSTHRU SYMINFO_FLG_FILTER /* unused obsolete name */
469 470 #define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */
470 471 #define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn. should be */
471 472 /* lazily-loaded */
472 473 #define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */
473 474 /* object containing defn. */
474 475 #define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */
475 476 /* directly bind to this symbol */
476 477 #define SYMINFO_FLG_AUXILIARY 0x0040 /* symbol ref is associated to a */
477 - /* auxiliary filter */
478 + /* auxiliary filter */
478 479 #define SYMINFO_FLG_INTERPOSE 0x0080 /* symbol defines an interposer */
479 480 #define SYMINFO_FLG_CAP 0x0100 /* symbol is capabilities specific */
480 481 #define SYMINFO_FLG_DEFERRED 0x0200 /* symbol should not be included in */
481 482 /* BIND_NOW relocations */
482 483
483 484 /*
484 485 * Syminfo.si_boundto values.
485 486 */
486 487 #define SYMINFO_BT_SELF 0xffff /* symbol bound to self */
487 488 #define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */
488 489 #define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */
489 490 #define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */
490 491 #define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */
491 492
492 493 /*
493 494 * Syminfo version values.
494 495 */
495 496 #define SYMINFO_NONE 0 /* Syminfo version */
496 497 #define SYMINFO_CURRENT 1
497 498 #define SYMINFO_NUM 2
498 499
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
499 500
500 501 /*
501 502 * Public structure defined and maintained within the runtime linker
502 503 */
503 504 #ifndef _ASM
504 505
505 506 typedef struct link_map Link_map;
506 507
507 508 struct link_map {
508 509 unsigned long l_addr; /* address at which object is mapped */
509 - char *l_name; /* full name of loaded object */
510 + char *l_name; /* full name of loaded object */
510 511 #ifdef _LP64
511 512 Elf64_Dyn *l_ld; /* dynamic structure of object */
512 513 #else
513 514 Elf32_Dyn *l_ld; /* dynamic structure of object */
514 515 #endif
515 516 Link_map *l_next; /* next link object */
516 517 Link_map *l_prev; /* previous link object */
517 518 char *l_refname; /* filters reference name */
518 519 };
519 520
520 521 #ifdef _SYSCALL32
521 522 typedef struct link_map32 Link_map32;
522 523
523 524 struct link_map32 {
524 525 Elf32_Word l_addr;
525 526 Elf32_Addr l_name;
526 527 Elf32_Addr l_ld;
527 528 Elf32_Addr l_next;
528 529 Elf32_Addr l_prev;
529 530 Elf32_Addr l_refname;
530 531 };
531 532 #endif
532 533
533 534 typedef enum {
534 535 RT_CONSISTENT,
535 536 RT_ADD,
536 537 RT_DELETE
537 538 } r_state_e;
538 539
539 540 typedef enum {
540 541 RD_FL_NONE = 0, /* no flags */
541 542 RD_FL_ODBG = (1<<0), /* old style debugger present */
542 543 RD_FL_DBG = (1<<1) /* debugging enabled */
543 544 } rd_flags_e;
544 545
545 546
546 547
547 548 /*
548 549 * Debugging events enabled inside of the runtime linker. To
549 550 * access these events see the librtld_db interface.
550 551 */
551 552 typedef enum {
552 553 RD_NONE = 0, /* no event */
553 554 RD_PREINIT, /* the Initial rendezvous before .init */
554 555 RD_POSTINIT, /* the Second rendezvous after .init */
555 556 RD_DLACTIVITY /* a dlopen or dlclose has happened */
556 557 } rd_event_e;
557 558
558 559 struct r_debug {
559 560 int r_version; /* debugging info version no. */
560 561 Link_map *r_map; /* address of link_map */
561 562 unsigned long r_brk; /* address of update routine */
562 563 r_state_e r_state;
563 564 unsigned long r_ldbase; /* base addr of ld.so */
564 565 Link_map *r_ldsomap; /* address of ld.so.1's link map */
565 566 rd_event_e r_rdevent; /* debug event */
566 567 rd_flags_e r_flags; /* misc flags. */
567 568 };
568 569
569 570 #ifdef _SYSCALL32
570 571 struct r_debug32 {
571 572 Elf32_Word r_version; /* debugging info version no. */
572 573 Elf32_Addr r_map; /* address of link_map */
573 574 Elf32_Word r_brk; /* address of update routine */
574 575 r_state_e r_state;
575 576 Elf32_Word r_ldbase; /* base addr of ld.so */
576 577 Elf32_Addr r_ldsomap; /* address of ld.so.1's link map */
577 578 rd_event_e r_rdevent; /* debug event */
578 579 rd_flags_e r_flags; /* misc flags. */
579 580 };
580 581 #endif
581 582
582 583
583 584 #define R_DEBUG_VERSION 2 /* current r_debug version */
584 585 #endif /* _ASM */
585 586
586 587 /*
587 588 * Attribute/value structures used to bootstrap ELF-based dynamic linker.
588 589 */
589 590 #ifndef _ASM
590 591 typedef struct {
591 592 Elf32_Sword eb_tag; /* what this one is */
592 593 union { /* possible values */
593 594 Elf32_Word eb_val;
594 595 Elf32_Addr eb_ptr;
595 596 Elf32_Off eb_off;
596 597 } eb_un;
597 598 } Elf32_Boot;
598 599
599 600 #if defined(_LP64) || defined(_LONGLONG_TYPE)
600 601 typedef struct {
601 602 Elf64_Xword eb_tag; /* what this one is */
602 603 union { /* possible values */
603 604 Elf64_Xword eb_val;
604 605 Elf64_Addr eb_ptr;
605 606 Elf64_Off eb_off;
606 607 } eb_un;
607 608 } Elf64_Boot;
608 609 #endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
609 610 #endif /* _ASM */
610 611
611 612 /*
612 613 * Attributes
613 614 */
614 615 #define EB_NULL 0 /* (void) last entry */
615 616 #define EB_DYNAMIC 1 /* (*) dynamic structure of subject */
616 617 #define EB_LDSO_BASE 2 /* (caddr_t) base address of ld.so */
617 618 #define EB_ARGV 3 /* (caddr_t) argument vector */
618 619 #define EB_ENVP 4 /* (char **) environment strings */
619 620 #define EB_AUXV 5 /* (auxv_t *) auxiliary vector */
620 621 #define EB_DEVZERO 6 /* (int) fd for /dev/zero */
621 622 #define EB_PAGESIZE 7 /* (int) page size */
622 623 #define EB_MAX 8 /* number of "EBs" */
623 624 #define EB_MAX_SIZE32 64 /* size in bytes, _ILP32 */
624 625 #define EB_MAX_SIZE64 128 /* size in bytes, _LP64 */
625 626
626 627
627 628 #ifndef _ASM
628 629
629 630 /*
630 631 * Concurrency communication structure for libc callbacks.
631 632 */
632 633 extern void _ld_libc(void *);
633 634
634 635 #pragma unknown_control_flow(_ld_libc)
635 636 #endif /* _ASM */
636 637
637 638 #ifdef __cplusplus
638 639 }
639 640 #endif
640 641
641 642 #endif /* _SYS_LINK_H */
↓ open down ↓ |
122 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX