xref: /titanic_51/usr/src/uts/common/sys/link.h (revision 3244bcaa97c6de4c5692dd87485de1ef73364ab5)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50bc07c75Srie  * Common Development and Distribution License (the "License").
60bc07c75Srie  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate 
227c478bd9Sstevel@tonic-gate /*
230bc07c75Srie  *	Copyright (c) 1988 AT&T
240bc07c75Srie  *	  All Rights Reserved
250bc07c75Srie  *
269a411307Srie  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _SYS_LINK_H
317c478bd9Sstevel@tonic-gate #define	_SYS_LINK_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifndef	_ASM
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate #include <sys/elftypes.h>
387c478bd9Sstevel@tonic-gate #endif
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
417c478bd9Sstevel@tonic-gate extern "C" {
427c478bd9Sstevel@tonic-gate #endif
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * Communication structures for the runtime linker.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate /*
497c478bd9Sstevel@tonic-gate  * The following data structure provides a self-identifying union consisting
507c478bd9Sstevel@tonic-gate  * of a tag from a known list and a value.
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate #ifndef	_ASM
537c478bd9Sstevel@tonic-gate typedef struct {
547c478bd9Sstevel@tonic-gate 	Elf32_Sword d_tag;		/* how to interpret value */
557c478bd9Sstevel@tonic-gate 	union {
567c478bd9Sstevel@tonic-gate 		Elf32_Word	d_val;
577c478bd9Sstevel@tonic-gate 		Elf32_Addr	d_ptr;
587c478bd9Sstevel@tonic-gate 		Elf32_Off	d_off;
597c478bd9Sstevel@tonic-gate 	} d_un;
607c478bd9Sstevel@tonic-gate } Elf32_Dyn;
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_LONGLONG_TYPE)
637c478bd9Sstevel@tonic-gate typedef struct {
647c478bd9Sstevel@tonic-gate 	Elf64_Xword d_tag;		/* how to interpret value */
657c478bd9Sstevel@tonic-gate 	union {
667c478bd9Sstevel@tonic-gate 		Elf64_Xword	d_val;
677c478bd9Sstevel@tonic-gate 		Elf64_Addr	d_ptr;
687c478bd9Sstevel@tonic-gate 	} d_un;
697c478bd9Sstevel@tonic-gate } Elf64_Dyn;
707c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_LONGLONG_TYPE) */
717c478bd9Sstevel@tonic-gate #endif	/* _ASM */
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /*
747c478bd9Sstevel@tonic-gate  * Tag values
757c478bd9Sstevel@tonic-gate  */
767c478bd9Sstevel@tonic-gate #define	DT_NULL		0	/* last entry in list */
777c478bd9Sstevel@tonic-gate #define	DT_NEEDED	1	/* a needed object */
787c478bd9Sstevel@tonic-gate #define	DT_PLTRELSZ	2	/* size of relocations for the PLT */
797c478bd9Sstevel@tonic-gate #define	DT_PLTGOT	3	/* addresses used by procedure linkage table */
807c478bd9Sstevel@tonic-gate #define	DT_HASH		4	/* hash table */
817c478bd9Sstevel@tonic-gate #define	DT_STRTAB	5	/* string table */
827c478bd9Sstevel@tonic-gate #define	DT_SYMTAB	6	/* symbol table */
837c478bd9Sstevel@tonic-gate #define	DT_RELA		7	/* addr of relocation entries */
847c478bd9Sstevel@tonic-gate #define	DT_RELASZ	8	/* size of relocation table */
857c478bd9Sstevel@tonic-gate #define	DT_RELAENT	9	/* base size of relocation entry */
867c478bd9Sstevel@tonic-gate #define	DT_STRSZ	10	/* size of string table */
877c478bd9Sstevel@tonic-gate #define	DT_SYMENT	11	/* size of symbol table entry */
887c478bd9Sstevel@tonic-gate #define	DT_INIT		12	/* _init addr */
897c478bd9Sstevel@tonic-gate #define	DT_FINI		13	/* _fini addr */
907c478bd9Sstevel@tonic-gate #define	DT_SONAME	14	/* name of this shared object */
917c478bd9Sstevel@tonic-gate #define	DT_RPATH	15	/* run-time search path */
927c478bd9Sstevel@tonic-gate #define	DT_SYMBOLIC	16	/* shared object linked -Bsymbolic */
937c478bd9Sstevel@tonic-gate #define	DT_REL		17	/* addr of relocation entries */
947c478bd9Sstevel@tonic-gate #define	DT_RELSZ	18	/* size of relocation table */
957c478bd9Sstevel@tonic-gate #define	DT_RELENT	19	/* base size of relocation entry */
967c478bd9Sstevel@tonic-gate #define	DT_PLTREL	20	/* relocation type for PLT entry */
977c478bd9Sstevel@tonic-gate #define	DT_DEBUG	21	/* pointer to r_debug structure */
987c478bd9Sstevel@tonic-gate #define	DT_TEXTREL	22	/* text relocations remain for this object */
997c478bd9Sstevel@tonic-gate #define	DT_JMPREL	23	/* pointer to the PLT relocation entries */
1007c478bd9Sstevel@tonic-gate #define	DT_BIND_NOW	24	/* perform all relocations at load of object */
1017c478bd9Sstevel@tonic-gate #define	DT_INIT_ARRAY	25	/* pointer to .initarray */
1027c478bd9Sstevel@tonic-gate #define	DT_FINI_ARRAY	26	/* pointer to .finiarray */
1037c478bd9Sstevel@tonic-gate #define	DT_INIT_ARRAYSZ	27	/* size of .initarray */
1047c478bd9Sstevel@tonic-gate #define	DT_FINI_ARRAYSZ	28	/* size of .finiarray */
1057c478bd9Sstevel@tonic-gate #define	DT_RUNPATH	29	/* run-time search path */
1067c478bd9Sstevel@tonic-gate #define	DT_FLAGS	30	/* state flags - see DF_* */
1077c478bd9Sstevel@tonic-gate 
108d579eb63Sab196087 /*
109d579eb63Sab196087  * DT_* encoding rules: The value of each dynamic tag determines the
110d579eb63Sab196087  * interpretation of the d_un union. This convention provides for simpler
111d579eb63Sab196087  * interpretation of dynamic tags by external tools. A tag whose value
112d579eb63Sab196087  * is an even number indicates a dynamic section entry that uses d_ptr.
113d579eb63Sab196087  * A tag whose value is an odd number indicates a dynamic section entry
114d579eb63Sab196087  * that uses d_val, or that uses neither d_ptr nor d_val.
115d579eb63Sab196087  *
116d579eb63Sab196087  * There are exceptions to the above rule:
117d579eb63Sab196087  *	- Tags with values that are less than DT_ENCODING.
118d579eb63Sab196087  *	- Tags with values that fall between DT_LOOS and DT_SUNW_ENCODING
119d579eb63Sab196087  *	- Tags with values that fall between DT_HIOS and DT_LOPROC
120d579eb63Sab196087  *
121d579eb63Sab196087  * Third party tools must handle these exception ranges explicitly
122d579eb63Sab196087  * on an item by item basis.
123d579eb63Sab196087  */
124d579eb63Sab196087 #define	DT_ENCODING		32	/* positive tag DT_* encoding rules */
125d579eb63Sab196087 					/*	start after this */
1267c478bd9Sstevel@tonic-gate #define	DT_PREINIT_ARRAY	32    /* pointer to .preinitarray segment */
1277c478bd9Sstevel@tonic-gate #define	DT_PREINIT_ARRAYSZ	33    /* size of .preinitarray segment */
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate #define	DT_MAXPOSTAGS		34	/* number of positive tags */
1307c478bd9Sstevel@tonic-gate 
131d579eb63Sab196087 /*
132d579eb63Sab196087  * DT_* encoding rules do not apply between DT_LOOS and DT_SUNW_ENCODING
133d579eb63Sab196087  */
1347c478bd9Sstevel@tonic-gate #define	DT_LOOS			0x6000000d	/* OS specific range */
1357c478bd9Sstevel@tonic-gate #define	DT_SUNW_AUXILIARY	0x6000000d	/* symbol auxiliary name */
1367c478bd9Sstevel@tonic-gate #define	DT_SUNW_RTLDINF		0x6000000e	/* ld.so.1 info (private) */
1377c478bd9Sstevel@tonic-gate #define	DT_SUNW_FILTER		0x6000000f	/* symbol filter name */
1387c478bd9Sstevel@tonic-gate #define	DT_SUNW_CAP		0x60000010	/* hardware/software */
1397c478bd9Sstevel@tonic-gate 						/*	capabilities */
1409039eeafSab196087 #define	DT_SUNW_SYMTAB		0x60000011	/* symtab with local fcn */
1419039eeafSab196087 						/*	symbols immediately */
1429039eeafSab196087 						/*	preceding DT_SYMTAB */
143d579eb63Sab196087 #define	DT_SUNW_SYMSZ		0x60000012	/* Size of SUNW_SYMTAB table */
144d579eb63Sab196087 
145d579eb63Sab196087 /*
146d579eb63Sab196087  * DT_* encoding rules apply between DT_SUNW_ENCODING and DT_HIOS
147d579eb63Sab196087  */
148d579eb63Sab196087 #define	DT_SUNW_ENCODING	0x60000013	/* DT_* encoding rules resume */
149d579eb63Sab196087 						/*	after this */
150d579eb63Sab196087 #define	DT_SUNW_SORTENT		0x60000013	/* sizeof [SYM|TLS]SORT entrt */
151d579eb63Sab196087 #define	DT_SUNW_SYMSORT		0x60000014	/* sym indices sorted by addr */
152d579eb63Sab196087 #define	DT_SUNW_SYMSORTSZ	0x60000015	/* size of SUNW_SYMSORT */
153d579eb63Sab196087 #define	DT_SUNW_TLSSORT		0x60000016	/* tls sym ndx sort by offset */
154d579eb63Sab196087 #define	DT_SUNW_TLSSORTSZ	0x60000017	/* size of SUNW_TLSSORT */
155d579eb63Sab196087 
156*3244bcaaSab196087 #define	DT_SUNW_STRPAD		0x60000019	/* # of unused bytes at the */
157*3244bcaaSab196087 						/*	end of dynstr */
158*3244bcaaSab196087 
159d579eb63Sab196087 /*
160d579eb63Sab196087  * DT_* encoding rules do not apply between DT_HIOS and DT_LOPROC
161d579eb63Sab196087  */
1627c478bd9Sstevel@tonic-gate #define	DT_HIOS			0x6ffff000
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate /*
1657c478bd9Sstevel@tonic-gate  * The following values have been deprecated and remain here to allow
1667c478bd9Sstevel@tonic-gate  * compatibility with older binaries.
1677c478bd9Sstevel@tonic-gate  */
1687c478bd9Sstevel@tonic-gate #define	DT_DEPRECATED_SPARC_REGISTER	0x7000001
1697c478bd9Sstevel@tonic-gate 
1707c478bd9Sstevel@tonic-gate /*
1717c478bd9Sstevel@tonic-gate  * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
1727c478bd9Sstevel@tonic-gate  * Dyn.d_un.d_val field of the Elf*_Dyn structure.
1737c478bd9Sstevel@tonic-gate  */
1747c478bd9Sstevel@tonic-gate #define	DT_VALRNGLO	0x6ffffd00
1757c478bd9Sstevel@tonic-gate #define	DT_CHECKSUM	0x6ffffdf8	/* elf checksum */
1767c478bd9Sstevel@tonic-gate #define	DT_PLTPADSZ	0x6ffffdf9	/* pltpadding size */
1777c478bd9Sstevel@tonic-gate #define	DT_MOVEENT	0x6ffffdfa	/* move table entry size */
1787c478bd9Sstevel@tonic-gate #define	DT_MOVESZ	0x6ffffdfb	/* move table size */
1797c478bd9Sstevel@tonic-gate #define	DT_FEATURE_1	0x6ffffdfc	/* feature holder */
1807c478bd9Sstevel@tonic-gate #define	DT_POSFLAG_1	0x6ffffdfd	/* flags for DT_* entries, effecting */
1817c478bd9Sstevel@tonic-gate 					/*	the following DT_* entry. */
1827c478bd9Sstevel@tonic-gate 					/*	See DF_P1_* definitions */
1837c478bd9Sstevel@tonic-gate #define	DT_SYMINSZ	0x6ffffdfe	/* syminfo table size (in bytes) */
1847c478bd9Sstevel@tonic-gate #define	DT_SYMINENT	0x6ffffdff	/* syminfo entry size (in bytes) */
1857c478bd9Sstevel@tonic-gate #define	DT_VALRNGHI	0x6ffffdff
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate /*
1887c478bd9Sstevel@tonic-gate  * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
1897c478bd9Sstevel@tonic-gate  * Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
1907c478bd9Sstevel@tonic-gate  *
1917c478bd9Sstevel@tonic-gate  * If any adjustment is made to the ELF object after it has been
1927c478bd9Sstevel@tonic-gate  * built, these entries will need to be adjusted.
1937c478bd9Sstevel@tonic-gate  */
1947c478bd9Sstevel@tonic-gate #define	DT_ADDRRNGLO	0x6ffffe00
1957c478bd9Sstevel@tonic-gate #define	DT_CONFIG	0x6ffffefa	/* configuration information */
1967c478bd9Sstevel@tonic-gate #define	DT_DEPAUDIT	0x6ffffefb	/* dependency auditing */
1977c478bd9Sstevel@tonic-gate #define	DT_AUDIT	0x6ffffefc	/* object auditing */
1987c478bd9Sstevel@tonic-gate #define	DT_PLTPAD	0x6ffffefd	/* pltpadding (sparcv9) */
1997c478bd9Sstevel@tonic-gate #define	DT_MOVETAB	0x6ffffefe	/* move table */
2007c478bd9Sstevel@tonic-gate #define	DT_SYMINFO	0x6ffffeff	/* syminfo table */
2017c478bd9Sstevel@tonic-gate #define	DT_ADDRRNGHI	0x6ffffeff
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate /*
2047c478bd9Sstevel@tonic-gate  * The following DT_* entries should have been assigned within one of the
2057c478bd9Sstevel@tonic-gate  * DT_* ranges, but existed before such ranges had been established.
2067c478bd9Sstevel@tonic-gate  */
2077c478bd9Sstevel@tonic-gate #define	DT_VERSYM	0x6ffffff0	/* version symbol table - unused */
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate #define	DT_RELACOUNT	0x6ffffff9	/* number of RELATIVE relocations */
2107c478bd9Sstevel@tonic-gate #define	DT_RELCOUNT	0x6ffffffa	/* number of RELATIVE relocations */
2117c478bd9Sstevel@tonic-gate #define	DT_FLAGS_1	0x6ffffffb	/* state flags - see DF_1_* defs */
2127c478bd9Sstevel@tonic-gate #define	DT_VERDEF	0x6ffffffc	/* version definition table and */
2137c478bd9Sstevel@tonic-gate #define	DT_VERDEFNUM	0x6ffffffd	/*	associated no. of entries */
2147c478bd9Sstevel@tonic-gate #define	DT_VERNEED	0x6ffffffe	/* version needed table and */
2157c478bd9Sstevel@tonic-gate #define	DT_VERNEEDNUM	0x6fffffff	/* 	associated no. of entries */
2167c478bd9Sstevel@tonic-gate 
2177c478bd9Sstevel@tonic-gate /*
2187c478bd9Sstevel@tonic-gate  * DT_* entries between DT_HIPROC and DT_LOPROC are reserved for processor
2197c478bd9Sstevel@tonic-gate  * specific semantics.
220d579eb63Sab196087  *
221d579eb63Sab196087  * DT_* encoding rules apply to all tag values larger than DT_LOPROC.
2227c478bd9Sstevel@tonic-gate  */
2237c478bd9Sstevel@tonic-gate #define	DT_LOPROC	0x70000000	/* processor specific range */
2247c478bd9Sstevel@tonic-gate #define	DT_AUXILIARY	0x7ffffffd	/* shared library auxiliary name */
2257c478bd9Sstevel@tonic-gate #define	DT_USED		0x7ffffffe	/* ignored - same as needed */
2267c478bd9Sstevel@tonic-gate #define	DT_FILTER	0x7fffffff	/* shared library filter name */
2277c478bd9Sstevel@tonic-gate #define	DT_HIPROC	0x7fffffff
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate 
2307c478bd9Sstevel@tonic-gate /*
2317c478bd9Sstevel@tonic-gate  * Values for DT_FLAGS
2327c478bd9Sstevel@tonic-gate  */
2337c478bd9Sstevel@tonic-gate #define	DF_ORIGIN	0x00000001	/* ORIGIN processing required */
2347c478bd9Sstevel@tonic-gate #define	DF_SYMBOLIC	0x00000002	/* symbolic bindings in effect */
2357c478bd9Sstevel@tonic-gate #define	DF_TEXTREL	0x00000004	/* text relocations remain */
2367c478bd9Sstevel@tonic-gate #define	DF_BIND_NOW	0x00000008	/* process all relocations */
2377c478bd9Sstevel@tonic-gate #define	DF_STATIC_TLS	0x00000010	/* obj. contains static TLS refs */
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate /*
2407c478bd9Sstevel@tonic-gate  * Values for the DT_POSFLAG_1 .dynamic entry.
2417c478bd9Sstevel@tonic-gate  * These values only affect the following DT_* entry.
2427c478bd9Sstevel@tonic-gate  */
2437c478bd9Sstevel@tonic-gate #define	DF_P1_LAZYLOAD	0x00000001	/* following object is to be */
2447c478bd9Sstevel@tonic-gate 					/*	lazy loaded */
2457c478bd9Sstevel@tonic-gate #define	DF_P1_GROUPPERM	0x00000002	/* following object's symbols are */
2467c478bd9Sstevel@tonic-gate 					/*	not available for general */
2477c478bd9Sstevel@tonic-gate 					/*	symbol bindings. */
2487c478bd9Sstevel@tonic-gate /*
2497c478bd9Sstevel@tonic-gate  * Values for the DT_FLAGS_1 .dynamic entry.
2507c478bd9Sstevel@tonic-gate  */
2517c478bd9Sstevel@tonic-gate #define	DF_1_NOW	0x00000001	/* set RTLD_NOW for this object */
2527c478bd9Sstevel@tonic-gate #define	DF_1_GLOBAL	0x00000002	/* set RTLD_GLOBAL for this object */
2537c478bd9Sstevel@tonic-gate #define	DF_1_GROUP	0x00000004	/* set RTLD_GROUP for this object */
2547c478bd9Sstevel@tonic-gate #define	DF_1_NODELETE	0x00000008	/* set RTLD_NODELETE for this object */
2557c478bd9Sstevel@tonic-gate #define	DF_1_LOADFLTR	0x00000010	/* trigger filtee loading at runtime */
2567c478bd9Sstevel@tonic-gate #define	DF_1_INITFIRST	0x00000020	/* set RTLD_INITFIRST for this object */
2577c478bd9Sstevel@tonic-gate #define	DF_1_NOOPEN	0x00000040	/* set RTLD_NOOPEN for this object */
2587c478bd9Sstevel@tonic-gate #define	DF_1_ORIGIN	0x00000080	/* ORIGIN processing required */
2597c478bd9Sstevel@tonic-gate #define	DF_1_DIRECT	0x00000100	/* direct binding enabled */
2607c478bd9Sstevel@tonic-gate #define	DF_1_TRANS	0x00000200
2619a411307Srie #define	DF_1_INTERPOSE	0x00000400	/* object is an interposer */
2627c478bd9Sstevel@tonic-gate #define	DF_1_NODEFLIB	0x00000800	/* ignore default library search path */
2637c478bd9Sstevel@tonic-gate #define	DF_1_NODUMP	0x00001000	/* object can't be dldump(3x)'ed */
2647c478bd9Sstevel@tonic-gate #define	DF_1_CONFALT	0x00002000	/* configuration alternative created */
2657c478bd9Sstevel@tonic-gate #define	DF_1_ENDFILTEE	0x00004000	/* filtee terminates filters search */
2667c478bd9Sstevel@tonic-gate #define	DF_1_DISPRELDNE	0x00008000	/* disp reloc applied at build time */
2677c478bd9Sstevel@tonic-gate #define	DF_1_DISPRELPND	0x00010000	/* disp reloc applied at run-time */
2687c478bd9Sstevel@tonic-gate #define	DF_1_NODIRECT	0x00020000	/* object contains symbols that */
2697c478bd9Sstevel@tonic-gate 					/*	cannot be directly bound to */
2700bc07c75Srie #define	DF_1_IGNMULDEF	0x00040000	/* internal: krtld ignore muldefs */
2710bc07c75Srie #define	DF_1_NOKSYMS	0x00080000	/* internal: don't export object's */
2720bc07c75Srie 					/*	symbols via /dev/ksyms */
2734899432aSab196087 #define	DF_1_NOHDR	0x00100000	/* mapfile ?N:1st segment mapping */
2744899432aSab196087 					/*	omits ELF & program headers */
275*3244bcaaSab196087 #define	DF_1_EDITED	0x00200000	/* object has been modified since */
276*3244bcaaSab196087 					/*	being built by 'ld' */
2770bc07c75Srie #define	DF_1_NORELOC	0x00400000	/* internal: unrelocated object */
2789a411307Srie #define	DF_1_SYMINTPOSE	0x00800000	/* individual symbol interposers */
2799a411307Srie 					/*	exist */
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate /*
2824899432aSab196087  * Values set to DT_FEATURE_1 tag's d_val.
2837c478bd9Sstevel@tonic-gate  */
2847c478bd9Sstevel@tonic-gate #define	DTF_1_PARINIT	0x00000001	/* partially initialization feature */
2857c478bd9Sstevel@tonic-gate #define	DTF_1_CONFEXP	0x00000002	/* configuration file expected */
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate /*
2897c478bd9Sstevel@tonic-gate  * Version structures.  There are three types of version structure:
2907c478bd9Sstevel@tonic-gate  *
2917c478bd9Sstevel@tonic-gate  *  o	A definition of the versions within the image itself.
2927c478bd9Sstevel@tonic-gate  *	Each version definition is assigned a unique index (starting from
2937c478bd9Sstevel@tonic-gate  *	VER_NDX_BGNDEF)	which is used to cross-reference symbols associated to
2947c478bd9Sstevel@tonic-gate  *	the version.  Each version can have one or more dependencies on other
2957c478bd9Sstevel@tonic-gate  *	version definitions within the image.  The version name, and any
2967c478bd9Sstevel@tonic-gate  *	dependency names, are specified in the version definition auxiliary
2977c478bd9Sstevel@tonic-gate  *	array.  Version definition entries require a version symbol index table.
2987c478bd9Sstevel@tonic-gate  *
2997c478bd9Sstevel@tonic-gate  *  o	A version requirement on a needed dependency.  Each needed entry
3007c478bd9Sstevel@tonic-gate  *	specifies the shared object dependency (as specified in DT_NEEDED).
3017c478bd9Sstevel@tonic-gate  *	One or more versions required from this dependency are specified in the
3027c478bd9Sstevel@tonic-gate  *	version needed auxiliary array.
3037c478bd9Sstevel@tonic-gate  *
3047c478bd9Sstevel@tonic-gate  *  o	A version symbol index table.  Each symbol indexes into this array
3057c478bd9Sstevel@tonic-gate  *	to determine its version index.  Index values of VER_NDX_BGNDEF or
3067c478bd9Sstevel@tonic-gate  *	greater indicate the version definition to which a symbol is associated.
3077c478bd9Sstevel@tonic-gate  *	(the size of a symbol index entry is recorded in the sh_info field).
3087c478bd9Sstevel@tonic-gate  */
3097c478bd9Sstevel@tonic-gate #ifndef	_ASM
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate typedef struct {			/* Version Definition Structure. */
3127c478bd9Sstevel@tonic-gate 	Elf32_Half	vd_version;	/* this structures version revision */
3137c478bd9Sstevel@tonic-gate 	Elf32_Half	vd_flags;	/* version information */
3147c478bd9Sstevel@tonic-gate 	Elf32_Half	vd_ndx;		/* version index */
3157c478bd9Sstevel@tonic-gate 	Elf32_Half	vd_cnt;		/* no. of associated aux entries */
3167c478bd9Sstevel@tonic-gate 	Elf32_Word	vd_hash;	/* version name hash value */
3177c478bd9Sstevel@tonic-gate 	Elf32_Word	vd_aux;		/* no. of bytes from start of this */
3187c478bd9Sstevel@tonic-gate 					/*	verdef to verdaux array */
3197c478bd9Sstevel@tonic-gate 	Elf32_Word	vd_next;	/* no. of bytes from start of this */
3207c478bd9Sstevel@tonic-gate } Elf32_Verdef;				/*	verdef to next verdef entry */
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate typedef struct {			/* Verdef Auxiliary Structure. */
3237c478bd9Sstevel@tonic-gate 	Elf32_Word	vda_name;	/* first element defines the version */
3247c478bd9Sstevel@tonic-gate 					/*	name. Additional entries */
3257c478bd9Sstevel@tonic-gate 					/*	define dependency names. */
3267c478bd9Sstevel@tonic-gate 	Elf32_Word	vda_next;	/* no. of bytes from start of this */
3277c478bd9Sstevel@tonic-gate } Elf32_Verdaux;			/*	verdaux to next verdaux entry */
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate typedef	struct {			/* Version Requirement Structure. */
3317c478bd9Sstevel@tonic-gate 	Elf32_Half	vn_version;	/* this structures version revision */
3327c478bd9Sstevel@tonic-gate 	Elf32_Half	vn_cnt;		/* no. of associated aux entries */
3337c478bd9Sstevel@tonic-gate 	Elf32_Word	vn_file;	/* name of needed dependency (file) */
3347c478bd9Sstevel@tonic-gate 	Elf32_Word	vn_aux;		/* no. of bytes from start of this */
3357c478bd9Sstevel@tonic-gate 					/*	verneed to vernaux array */
3367c478bd9Sstevel@tonic-gate 	Elf32_Word	vn_next;	/* no. of bytes from start of this */
3377c478bd9Sstevel@tonic-gate } Elf32_Verneed;			/*	verneed to next verneed entry */
3387c478bd9Sstevel@tonic-gate 
3397c478bd9Sstevel@tonic-gate typedef struct {			/* Verneed Auxiliary Structure. */
3407c478bd9Sstevel@tonic-gate 	Elf32_Word	vna_hash;	/* version name hash value */
3417c478bd9Sstevel@tonic-gate 	Elf32_Half	vna_flags;	/* version information */
3427c478bd9Sstevel@tonic-gate 	Elf32_Half	vna_other;
3437c478bd9Sstevel@tonic-gate 	Elf32_Word	vna_name;	/* version name */
3447c478bd9Sstevel@tonic-gate 	Elf32_Word	vna_next;	/* no. of bytes from start of this */
3457c478bd9Sstevel@tonic-gate } Elf32_Vernaux;			/*	vernaux to next vernaux entry */
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate typedef	Elf32_Half 	Elf32_Versym;	/* Version symbol index array */
3487c478bd9Sstevel@tonic-gate 
3497c478bd9Sstevel@tonic-gate typedef struct {
3507c478bd9Sstevel@tonic-gate 	Elf32_Half	si_boundto;	/* direct bindings - symbol bound to */
3517c478bd9Sstevel@tonic-gate 	Elf32_Half	si_flags;	/* per symbol flags */
3527c478bd9Sstevel@tonic-gate } Elf32_Syminfo;
3537c478bd9Sstevel@tonic-gate 
3547c478bd9Sstevel@tonic-gate 
3557c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_LONGLONG_TYPE)
3567c478bd9Sstevel@tonic-gate typedef struct {
3577c478bd9Sstevel@tonic-gate 	Elf64_Half	vd_version;	/* this structures version revision */
3587c478bd9Sstevel@tonic-gate 	Elf64_Half	vd_flags;	/* version information */
3597c478bd9Sstevel@tonic-gate 	Elf64_Half	vd_ndx;		/* version index */
3607c478bd9Sstevel@tonic-gate 	Elf64_Half	vd_cnt;		/* no. of associated aux entries */
3617c478bd9Sstevel@tonic-gate 	Elf64_Word	vd_hash;	/* version name hash value */
3627c478bd9Sstevel@tonic-gate 	Elf64_Word	vd_aux;		/* no. of bytes from start of this */
3637c478bd9Sstevel@tonic-gate 					/*	verdef to verdaux array */
3647c478bd9Sstevel@tonic-gate 	Elf64_Word	vd_next;	/* no. of bytes from start of this */
3657c478bd9Sstevel@tonic-gate } Elf64_Verdef;				/*	verdef to next verdef entry */
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate typedef struct {
3687c478bd9Sstevel@tonic-gate 	Elf64_Word	vda_name;	/* first element defines the version */
3697c478bd9Sstevel@tonic-gate 					/*	name. Additional entries */
3707c478bd9Sstevel@tonic-gate 					/*	define dependency names. */
3717c478bd9Sstevel@tonic-gate 	Elf64_Word	vda_next;	/* no. of bytes from start of this */
3727c478bd9Sstevel@tonic-gate } Elf64_Verdaux;			/*	verdaux to next verdaux entry */
3737c478bd9Sstevel@tonic-gate 
3747c478bd9Sstevel@tonic-gate typedef struct {
3757c478bd9Sstevel@tonic-gate 	Elf64_Half	vn_version;	/* this structures version revision */
3767c478bd9Sstevel@tonic-gate 	Elf64_Half	vn_cnt;		/* no. of associated aux entries */
3777c478bd9Sstevel@tonic-gate 	Elf64_Word	vn_file;	/* name of needed dependency (file) */
3787c478bd9Sstevel@tonic-gate 	Elf64_Word	vn_aux;		/* no. of bytes from start of this */
3797c478bd9Sstevel@tonic-gate 					/*	verneed to vernaux array */
3807c478bd9Sstevel@tonic-gate 	Elf64_Word	vn_next;	/* no. of bytes from start of this */
3817c478bd9Sstevel@tonic-gate } Elf64_Verneed;			/*	verneed to next verneed entry */
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate typedef struct {
3847c478bd9Sstevel@tonic-gate 	Elf64_Word	vna_hash;	/* version name hash value */
3857c478bd9Sstevel@tonic-gate 	Elf64_Half	vna_flags;	/* version information */
3867c478bd9Sstevel@tonic-gate 	Elf64_Half	vna_other;
3877c478bd9Sstevel@tonic-gate 	Elf64_Word	vna_name;	/* version name */
3887c478bd9Sstevel@tonic-gate 	Elf64_Word	vna_next;	/* no. of bytes from start of this */
3897c478bd9Sstevel@tonic-gate } Elf64_Vernaux;			/*	vernaux to next vernaux entry */
3907c478bd9Sstevel@tonic-gate 
3917c478bd9Sstevel@tonic-gate typedef	Elf64_Half	Elf64_Versym;
3927c478bd9Sstevel@tonic-gate 
3937c478bd9Sstevel@tonic-gate typedef struct {
3947c478bd9Sstevel@tonic-gate 	Elf64_Half	si_boundto;	/* direct bindings - symbol bound to */
3957c478bd9Sstevel@tonic-gate 	Elf64_Half	si_flags;	/* per symbol flags */
3967c478bd9Sstevel@tonic-gate } Elf64_Syminfo;
3977c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_LONGLONG_TYPE) */
3987c478bd9Sstevel@tonic-gate 
3997c478bd9Sstevel@tonic-gate #endif	/* _ASM */
4007c478bd9Sstevel@tonic-gate 
4017c478bd9Sstevel@tonic-gate /*
4027c478bd9Sstevel@tonic-gate  * Versym symbol index values.  Values greater than VER_NDX_GLOBAL
4037c478bd9Sstevel@tonic-gate  * and less then VER_NDX_LORESERVE associate symbols with user
4047c478bd9Sstevel@tonic-gate  * specified version descriptors.
4057c478bd9Sstevel@tonic-gate  */
4067c478bd9Sstevel@tonic-gate #define	VER_NDX_LOCAL		0	/* symbol is local */
4077c478bd9Sstevel@tonic-gate #define	VER_NDX_GLOBAL		1	/* symbol is global and assigned to */
4087c478bd9Sstevel@tonic-gate 					/*	the base version */
4097c478bd9Sstevel@tonic-gate #define	VER_NDX_LORESERVE	0xff00	/* beginning of RESERVED entries */
4107c478bd9Sstevel@tonic-gate #define	VER_NDX_ELIMINATE	0xff01	/* symbol is to be eliminated */
4117c478bd9Sstevel@tonic-gate 
4127c478bd9Sstevel@tonic-gate /*
4137c478bd9Sstevel@tonic-gate  * Verdef and Verneed (via Veraux) flags values.
4147c478bd9Sstevel@tonic-gate  */
4157c478bd9Sstevel@tonic-gate #define	VER_FLG_BASE		0x1	/* version definition of file itself */
4167c478bd9Sstevel@tonic-gate #define	VER_FLG_WEAK		0x2	/* weak version identifier */
4177c478bd9Sstevel@tonic-gate 
4187c478bd9Sstevel@tonic-gate /*
4197c478bd9Sstevel@tonic-gate  * Verdef version values.
4207c478bd9Sstevel@tonic-gate  */
4217c478bd9Sstevel@tonic-gate #define	VER_DEF_NONE		0	/* Ver_def version */
4227c478bd9Sstevel@tonic-gate #define	VER_DEF_CURRENT		1
4237c478bd9Sstevel@tonic-gate #define	VER_DEF_NUM		2
4247c478bd9Sstevel@tonic-gate 
4257c478bd9Sstevel@tonic-gate /*
4267c478bd9Sstevel@tonic-gate  * Verneed version values.
4277c478bd9Sstevel@tonic-gate  */
4287c478bd9Sstevel@tonic-gate #define	VER_NEED_NONE		0	/* Ver_need version */
4297c478bd9Sstevel@tonic-gate #define	VER_NEED_CURRENT	1
4307c478bd9Sstevel@tonic-gate #define	VER_NEED_NUM		2
4317c478bd9Sstevel@tonic-gate 
4327c478bd9Sstevel@tonic-gate 
4337c478bd9Sstevel@tonic-gate /*
4347c478bd9Sstevel@tonic-gate  * Syminfo flag values
4357c478bd9Sstevel@tonic-gate  */
4367c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_DIRECT	0x0001	/* symbol ref has direct association */
4377c478bd9Sstevel@tonic-gate 					/*	to object containing defn. */
4387c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_PASSTHRU	0x0002	/* ignored - see SYMINFO_FLG_FILTER */
4397c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_COPY	0x0004	/* symbol is a copy-reloc */
4409a411307Srie #define	SYMINFO_FLG_LAZYLOAD	0x0008	/* object containing defn. should be */
4417c478bd9Sstevel@tonic-gate 					/*	lazily-loaded */
4427c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_DIRECTBIND	0x0010	/* ref should be bound directly to */
4437c478bd9Sstevel@tonic-gate 					/*	object containing defn. */
4447c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_NOEXTDIRECT	0x0020	/* don't let an external reference */
4457c478bd9Sstevel@tonic-gate 					/*	directly bind to this symbol */
4467c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_FILTER	0x0002	/* symbol ref is associated to a */
4477c478bd9Sstevel@tonic-gate #define	SYMINFO_FLG_AUXILIARY	0x0040	/* 	standard or auxiliary filter */
4489a411307Srie #define	SYMINFO_FLG_INTERPOSE	0x0080	/* symbol defines an interposer */
4497c478bd9Sstevel@tonic-gate 
4507c478bd9Sstevel@tonic-gate /*
4517c478bd9Sstevel@tonic-gate  * Syminfo.si_boundto values.
4527c478bd9Sstevel@tonic-gate  */
4537c478bd9Sstevel@tonic-gate #define	SYMINFO_BT_SELF		0xffff	/* symbol bound to self */
4547c478bd9Sstevel@tonic-gate #define	SYMINFO_BT_PARENT	0xfffe	/* symbol bound to parent */
4557c478bd9Sstevel@tonic-gate #define	SYMINFO_BT_NONE		0xfffd	/* no special symbol binding */
4567c478bd9Sstevel@tonic-gate #define	SYMINFO_BT_EXTERN	0xfffc	/* symbol defined as external */
4577c478bd9Sstevel@tonic-gate #define	SYMINFO_BT_LOWRESERVE	0xff00	/* beginning of reserved entries */
4587c478bd9Sstevel@tonic-gate 
4597c478bd9Sstevel@tonic-gate /*
4607c478bd9Sstevel@tonic-gate  * Syminfo version values.
4617c478bd9Sstevel@tonic-gate  */
4627c478bd9Sstevel@tonic-gate #define	SYMINFO_NONE		0	/* Syminfo version */
4637c478bd9Sstevel@tonic-gate #define	SYMINFO_CURRENT		1
4647c478bd9Sstevel@tonic-gate #define	SYMINFO_NUM		2
4657c478bd9Sstevel@tonic-gate 
4667c478bd9Sstevel@tonic-gate 
4677c478bd9Sstevel@tonic-gate /*
4687c478bd9Sstevel@tonic-gate  * Public structure defined and maintained within the runtime linker
4697c478bd9Sstevel@tonic-gate  */
4707c478bd9Sstevel@tonic-gate #ifndef	_ASM
4717c478bd9Sstevel@tonic-gate 
4727c478bd9Sstevel@tonic-gate typedef struct link_map	Link_map;
4737c478bd9Sstevel@tonic-gate 
4747c478bd9Sstevel@tonic-gate struct link_map {
4757c478bd9Sstevel@tonic-gate 	unsigned long	l_addr;		/* address at which object is mapped */
4767c478bd9Sstevel@tonic-gate 	char 		*l_name;	/* full name of loaded object */
4777c478bd9Sstevel@tonic-gate #ifdef _LP64
4787c478bd9Sstevel@tonic-gate 	Elf64_Dyn	*l_ld;		/* dynamic structure of object */
4797c478bd9Sstevel@tonic-gate #else
4807c478bd9Sstevel@tonic-gate 	Elf32_Dyn	*l_ld;		/* dynamic structure of object */
4817c478bd9Sstevel@tonic-gate #endif
4827c478bd9Sstevel@tonic-gate 	Link_map	*l_next;	/* next link object */
4837c478bd9Sstevel@tonic-gate 	Link_map	*l_prev;	/* previous link object */
4847c478bd9Sstevel@tonic-gate 	char		*l_refname;	/* filters reference name */
4857c478bd9Sstevel@tonic-gate };
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
4887c478bd9Sstevel@tonic-gate typedef struct link_map32 Link_map32;
4897c478bd9Sstevel@tonic-gate 
4907c478bd9Sstevel@tonic-gate struct link_map32 {
4917c478bd9Sstevel@tonic-gate 	Elf32_Word	l_addr;
4927c478bd9Sstevel@tonic-gate 	Elf32_Addr	l_name;
4937c478bd9Sstevel@tonic-gate 	Elf32_Addr	l_ld;
4947c478bd9Sstevel@tonic-gate 	Elf32_Addr	l_next;
4957c478bd9Sstevel@tonic-gate 	Elf32_Addr	l_prev;
4967c478bd9Sstevel@tonic-gate 	Elf32_Addr	l_refname;
4977c478bd9Sstevel@tonic-gate };
4987c478bd9Sstevel@tonic-gate #endif
4997c478bd9Sstevel@tonic-gate 
5007c478bd9Sstevel@tonic-gate typedef enum {
5017c478bd9Sstevel@tonic-gate 	RT_CONSISTENT,
5027c478bd9Sstevel@tonic-gate 	RT_ADD,
5037c478bd9Sstevel@tonic-gate 	RT_DELETE
5047c478bd9Sstevel@tonic-gate } r_state_e;
5057c478bd9Sstevel@tonic-gate 
5067c478bd9Sstevel@tonic-gate typedef enum {
5077c478bd9Sstevel@tonic-gate 	RD_FL_NONE = 0,		/* no flags */
5087c478bd9Sstevel@tonic-gate 	RD_FL_ODBG = (1<<0),	/* old style debugger present */
5097c478bd9Sstevel@tonic-gate 	RD_FL_DBG = (1<<1)	/* debugging enabled */
5107c478bd9Sstevel@tonic-gate } rd_flags_e;
5117c478bd9Sstevel@tonic-gate 
5127c478bd9Sstevel@tonic-gate 
5137c478bd9Sstevel@tonic-gate 
5147c478bd9Sstevel@tonic-gate /*
5157c478bd9Sstevel@tonic-gate  * Debugging events enabled inside of the runtime linker.  To
5167c478bd9Sstevel@tonic-gate  * access these events see the librtld_db interface.
5177c478bd9Sstevel@tonic-gate  */
5187c478bd9Sstevel@tonic-gate typedef enum {
5197c478bd9Sstevel@tonic-gate 	RD_NONE = 0,		/* no event */
5207c478bd9Sstevel@tonic-gate 	RD_PREINIT,		/* the Initial rendezvous before .init */
5217c478bd9Sstevel@tonic-gate 	RD_POSTINIT,		/* the Second rendezvous after .init */
5227c478bd9Sstevel@tonic-gate 	RD_DLACTIVITY		/* a dlopen or dlclose has happened */
5237c478bd9Sstevel@tonic-gate } rd_event_e;
5247c478bd9Sstevel@tonic-gate 
5257c478bd9Sstevel@tonic-gate struct r_debug {
5267c478bd9Sstevel@tonic-gate 	int		r_version;	/* debugging info version no. */
5277c478bd9Sstevel@tonic-gate 	Link_map	*r_map;		/* address of link_map */
5287c478bd9Sstevel@tonic-gate 	unsigned long	r_brk;		/* address of update routine */
5297c478bd9Sstevel@tonic-gate 	r_state_e	r_state;
5307c478bd9Sstevel@tonic-gate 	unsigned long	r_ldbase;	/* base addr of ld.so */
5317c478bd9Sstevel@tonic-gate 	Link_map	*r_ldsomap;	/* address of ld.so.1's link map */
5327c478bd9Sstevel@tonic-gate 	rd_event_e	r_rdevent;	/* debug event */
5337c478bd9Sstevel@tonic-gate 	rd_flags_e	r_flags;	/* misc flags. */
5347c478bd9Sstevel@tonic-gate };
5357c478bd9Sstevel@tonic-gate 
5367c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
5377c478bd9Sstevel@tonic-gate struct r_debug32 {
5387c478bd9Sstevel@tonic-gate 	Elf32_Word	r_version;	/* debugging info version no. */
5397c478bd9Sstevel@tonic-gate 	Elf32_Addr	r_map;		/* address of link_map */
5407c478bd9Sstevel@tonic-gate 	Elf32_Word	r_brk;		/* address of update routine */
5417c478bd9Sstevel@tonic-gate 	r_state_e	r_state;
5427c478bd9Sstevel@tonic-gate 	Elf32_Word	r_ldbase;	/* base addr of ld.so */
5437c478bd9Sstevel@tonic-gate 	Elf32_Addr	r_ldsomap;	/* address of ld.so.1's link map */
5447c478bd9Sstevel@tonic-gate 	rd_event_e	r_rdevent;	/* debug event */
5457c478bd9Sstevel@tonic-gate 	rd_flags_e	r_flags;	/* misc flags. */
5467c478bd9Sstevel@tonic-gate };
5477c478bd9Sstevel@tonic-gate #endif
5487c478bd9Sstevel@tonic-gate 
5497c478bd9Sstevel@tonic-gate 
5507c478bd9Sstevel@tonic-gate #define	R_DEBUG_VERSION	2		/* current r_debug version */
5517c478bd9Sstevel@tonic-gate #endif	/* _ASM */
5527c478bd9Sstevel@tonic-gate 
5537c478bd9Sstevel@tonic-gate /*
5547c478bd9Sstevel@tonic-gate  * Attribute/value structures used to bootstrap ELF-based dynamic linker.
5557c478bd9Sstevel@tonic-gate  */
5567c478bd9Sstevel@tonic-gate #ifndef	_ASM
5577c478bd9Sstevel@tonic-gate typedef struct {
5587c478bd9Sstevel@tonic-gate 	Elf32_Sword eb_tag;		/* what this one is */
5597c478bd9Sstevel@tonic-gate 	union {				/* possible values */
5607c478bd9Sstevel@tonic-gate 		Elf32_Word eb_val;
5617c478bd9Sstevel@tonic-gate 		Elf32_Addr eb_ptr;
5627c478bd9Sstevel@tonic-gate 		Elf32_Off  eb_off;
5637c478bd9Sstevel@tonic-gate 	} eb_un;
5647c478bd9Sstevel@tonic-gate } Elf32_Boot;
5657c478bd9Sstevel@tonic-gate 
5667c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_LONGLONG_TYPE)
5677c478bd9Sstevel@tonic-gate typedef struct {
5687c478bd9Sstevel@tonic-gate 	Elf64_Xword eb_tag;		/* what this one is */
5697c478bd9Sstevel@tonic-gate 	union {				/* possible values */
5707c478bd9Sstevel@tonic-gate 		Elf64_Xword eb_val;
5717c478bd9Sstevel@tonic-gate 		Elf64_Addr eb_ptr;
5727c478bd9Sstevel@tonic-gate 		Elf64_Off eb_off;
5737c478bd9Sstevel@tonic-gate 	} eb_un;
5747c478bd9Sstevel@tonic-gate } Elf64_Boot;
5757c478bd9Sstevel@tonic-gate #endif	/* defined(_LP64) || defined(_LONGLONG_TYPE) */
5767c478bd9Sstevel@tonic-gate #endif	/* _ASM */
5777c478bd9Sstevel@tonic-gate 
5787c478bd9Sstevel@tonic-gate /*
5797c478bd9Sstevel@tonic-gate  * Attributes
5807c478bd9Sstevel@tonic-gate  */
5817c478bd9Sstevel@tonic-gate #define	EB_NULL		0		/* (void) last entry */
5827c478bd9Sstevel@tonic-gate #define	EB_DYNAMIC	1		/* (*) dynamic structure of subject */
5837c478bd9Sstevel@tonic-gate #define	EB_LDSO_BASE	2		/* (caddr_t) base address of ld.so */
5847c478bd9Sstevel@tonic-gate #define	EB_ARGV		3		/* (caddr_t) argument vector */
5857c478bd9Sstevel@tonic-gate #define	EB_ENVP		4		/* (char **) environment strings */
5867c478bd9Sstevel@tonic-gate #define	EB_AUXV		5		/* (auxv_t *) auxiliary vector */
5877c478bd9Sstevel@tonic-gate #define	EB_DEVZERO	6		/* (int) fd for /dev/zero */
5887c478bd9Sstevel@tonic-gate #define	EB_PAGESIZE	7		/* (int) page size */
5897c478bd9Sstevel@tonic-gate #define	EB_MAX		8		/* number of "EBs" */
5907c478bd9Sstevel@tonic-gate #define	EB_MAX_SIZE32	64		/* size in bytes, _ILP32 */
5917c478bd9Sstevel@tonic-gate #define	EB_MAX_SIZE64	128		/* size in bytes, _LP64 */
5927c478bd9Sstevel@tonic-gate 
5937c478bd9Sstevel@tonic-gate 
5947c478bd9Sstevel@tonic-gate #ifndef	_ASM
5957c478bd9Sstevel@tonic-gate 
5967c478bd9Sstevel@tonic-gate #ifdef __STDC__
5977c478bd9Sstevel@tonic-gate 
5987c478bd9Sstevel@tonic-gate /*
5997c478bd9Sstevel@tonic-gate  * Concurrency communication structure for libc callbacks.
6007c478bd9Sstevel@tonic-gate  */
6017c478bd9Sstevel@tonic-gate extern void	_ld_libc(void *);
6027c478bd9Sstevel@tonic-gate #else /* __STDC__ */
6037c478bd9Sstevel@tonic-gate extern void	_ld_libc();
6047c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
6057c478bd9Sstevel@tonic-gate 
6067c478bd9Sstevel@tonic-gate #pragma unknown_control_flow(_ld_libc)
6077c478bd9Sstevel@tonic-gate #endif /* _ASM */
6087c478bd9Sstevel@tonic-gate 
6097c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
6107c478bd9Sstevel@tonic-gate }
6117c478bd9Sstevel@tonic-gate #endif
6127c478bd9Sstevel@tonic-gate 
6137c478bd9Sstevel@tonic-gate #endif	/* _SYS_LINK_H */
614