link.h revision 4899432a4abc50d8c3d81d5faf257b92517b7716
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1988 AT&T
* All Rights Reserved
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_LINK_H
#define _SYS_LINK_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef _ASM
#include <sys/elftypes.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Communication structures for the runtime linker.
*/
/*
* The following data structure provides a self-identifying union consisting
* of a tag from a known list and a value.
*/
#ifndef _ASM
typedef struct {
union {
} d_un;
} Elf32_Dyn;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
union {
} d_un;
} Elf64_Dyn;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif /* _ASM */
/*
* Tag values
*/
#define DT_NULL 0 /* last entry in list */
/* capabilities */
#define DT_HIOS 0x6ffff000
/*
* The following values have been deprecated and remain here to allow
* compatibility with older binaries.
*/
#define DT_DEPRECATED_SPARC_REGISTER 0x7000001
/*
* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
* Dyn.d_un.d_val field of the Elf*_Dyn structure.
*/
#define DT_VALRNGLO 0x6ffffd00
/* the following DT_* entry. */
/* See DF_P1_* definitions */
#define DT_VALRNGHI 0x6ffffdff
/*
* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
* Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
*
* If any adjustment is made to the ELF object after it has been
* built, these entries will need to be adjusted.
*/
#define DT_ADDRRNGLO 0x6ffffe00
#define DT_ADDRRNGHI 0x6ffffeff
/*
* The following DT_* entries should have been assigned within one of the
* DT_* ranges, but existed before such ranges had been established.
*/
/*
* DT_* entries between DT_HIPROC and DT_LOPROC are reserved for processor
* specific semantics.
*/
#define DT_HIPROC 0x7fffffff
/*
* Values for DT_FLAGS
*/
/*
* Values for the DT_POSFLAG_1 .dynamic entry.
* These values only affect the following DT_* entry.
*/
/* lazy loaded */
/* not available for general */
/* symbol bindings. */
/*
* Values for the DT_FLAGS_1 .dynamic entry.
*/
#define DF_1_TRANS 0x00000200
/* cannot be directly bound to */
/* omits ELF & program headers */
/*
* Values set to DT_FEATURE_1 tag's d_val.
*/
/*
* Version structures. There are three types of version structure:
*
* o A definition of the versions within the image itself.
* Each version definition is assigned a unique index (starting from
* VER_NDX_BGNDEF) which is used to cross-reference symbols associated to
* the version. Each version can have one or more dependencies on other
* version definitions within the image. The version name, and any
* dependency names, are specified in the version definition auxiliary
* array. Version definition entries require a version symbol index table.
*
* o A version requirement on a needed dependency. Each needed entry
* specifies the shared object dependency (as specified in DT_NEEDED).
* One or more versions required from this dependency are specified in the
* version needed auxiliary array.
*
* o A version symbol index table. Each symbol indexes into this array
* to determine its version index. Index values of VER_NDX_BGNDEF or
* greater indicate the version definition to which a symbol is associated.
* (the size of a symbol index entry is recorded in the sh_info field).
*/
#ifndef _ASM
typedef struct { /* Version Definition Structure. */
/* verdef to verdaux array */
} Elf32_Verdef; /* verdef to next verdef entry */
typedef struct { /* Verdef Auxiliary Structure. */
/* name. Additional entries */
/* define dependency names. */
} Elf32_Verdaux; /* verdaux to next verdaux entry */
typedef struct { /* Version Requirement Structure. */
/* verneed to vernaux array */
} Elf32_Verneed; /* verneed to next verneed entry */
typedef struct { /* Verneed Auxiliary Structure. */
} Elf32_Vernaux; /* vernaux to next vernaux entry */
typedef struct {
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
/* verdef to verdaux array */
} Elf64_Verdef; /* verdef to next verdef entry */
typedef struct {
/* name. Additional entries */
/* define dependency names. */
} Elf64_Verdaux; /* verdaux to next verdaux entry */
typedef struct {
/* verneed to vernaux array */
} Elf64_Verneed; /* verneed to next verneed entry */
typedef struct {
} Elf64_Vernaux; /* vernaux to next vernaux entry */
typedef Elf64_Half Elf64_Versym;
typedef struct {
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif /* _ASM */
/*
* Versym symbol index values. Values greater than VER_NDX_GLOBAL
* and less then VER_NDX_LORESERVE associate symbols with user
* specified version descriptors.
*/
#define VER_NDX_LOCAL 0 /* symbol is local */
/* the base version */
/*
* Verdef and Verneed (via Veraux) flags values.
*/
/*
* Verdef version values.
*/
#define VER_DEF_NONE 0 /* Ver_def version */
#define VER_DEF_CURRENT 1
#define VER_DEF_NUM 2
/*
* Verneed version values.
*/
#define VER_NEED_NONE 0 /* Ver_need version */
#define VER_NEED_CURRENT 1
#define VER_NEED_NUM 2
/*
* Syminfo flag values
*/
/* to object containing defn. */
/* lazily-loaded */
/* object containing defn. */
/* directly bind to this symbol */
/*
* Syminfo.si_boundto values.
*/
/*
* Syminfo version values.
*/
#define SYMINFO_NONE 0 /* Syminfo version */
#define SYMINFO_CURRENT 1
#define SYMINFO_NUM 2
/*
* Public structure defined and maintained within the runtime linker
*/
#ifndef _ASM
struct link_map {
unsigned long l_addr; /* address at which object is mapped */
char *l_name; /* full name of loaded object */
#ifdef _LP64
#else
#endif
char *l_refname; /* filters reference name */
};
#ifdef _SYSCALL32
typedef struct link_map32 Link_map32;
struct link_map32 {
};
#endif
typedef enum {
} r_state_e;
typedef enum {
RD_FL_NONE = 0, /* no flags */
} rd_flags_e;
/*
* Debugging events enabled inside of the runtime linker. To
* access these events see the librtld_db interface.
*/
typedef enum {
RD_NONE = 0, /* no event */
RD_PREINIT, /* the Initial rendezvous before .init */
RD_POSTINIT, /* the Second rendezvous after .init */
RD_DLACTIVITY /* a dlopen or dlclose has happened */
} rd_event_e;
struct r_debug {
int r_version; /* debugging info version no. */
unsigned long r_brk; /* address of update routine */
};
#ifdef _SYSCALL32
struct r_debug32 {
};
#endif
#endif /* _ASM */
/*
*/
#ifndef _ASM
typedef struct {
union { /* possible values */
} eb_un;
} Elf32_Boot;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
union { /* possible values */
} eb_un;
} Elf64_Boot;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif /* _ASM */
/*
* Attributes
*/
#define EB_NULL 0 /* (void) last entry */
#ifndef _ASM
#ifdef __STDC__
/*
* Concurrency communication structure for libc callbacks.
*/
extern void _ld_libc(void *);
#else /* __STDC__ */
extern void _ld_libc();
#endif /* __STDC__ */
#pragma unknown_control_flow(_ld_libc)
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_LINK_H */