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