link.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LINK_H
#define _LINK_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef _ASM
#include <libelf.h>
#include <dlfcn.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
/*
* ld support library calls
*/
#ifdef __STDC__
extern void ld_start(const char *, const Elf32_Half, const char *);
extern void ld_atexit(int);
extern void ld_input_done(uint_t *);
#if defined(_LP64) || defined(_LONGLONG_TYPE)
extern void ld_start64(const char *, const Elf64_Half, const char *);
extern void ld_atexit64(int);
#endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
#else
extern void ld_version();
extern void ld_start();
extern void ld_atexit();
extern void ld_file();
extern void ld_input_section();
extern void ld_input_done();
extern void ld_section();
#if defined(_LP64) || defined(_LONGLONG_TYPE)
extern void ld_start64();
extern void ld_atexit64();
extern void ld_file64();
extern void ld_section64();
#endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif /* __STDC__ */
/*
* ld_version() version values
*/
#define LD_SUP_VNONE 0
#define LD_SUP_VERSION1 1
#define LD_SUP_VERSION2 2
#define LD_SUP_VCURRENT LD_SUP_VERSION2
/*
* flags passed to ld support calls
*/
#endif
#define LM_ID_BASE 0x00
#define LM_ID_LDSO 0x01
#define LM_ID_NUM 2
/*
* Run-Time Link-Edit Auditing
*/
#define LAV_NONE 0
#define LAV_VERSION1 1
#define LAV_VERSION2 2
#define LAV_VERSION3 3
#define LAV_CURRENT LAV_VERSION3
#define LAV_NUM 4
/*
* Flags that can be or'd into the la_objopen() return code
*/
/*
* Flags that can be or'd into the 'flags' argument of la_symbind()
*/
/* structure as it's return code */
/* a call to dlsym() */
/* by la_symbind() */
/*
* Flags that describe the object passed to la_objsearch()
*/
/*
* Flags that describe the la_activity()
*/
#ifndef _KERNEL
#ifndef _ASM
#if defined(_LP64)
typedef long lagreg_t;
#else
typedef int lagreg_t;
#endif
struct _la_sparc_regs {
};
#if defined(_LP64)
typedef struct _la_sparc_regs La_sparcv9_regs;
typedef struct {
#else
typedef struct _la_sparc_regs La_sparcv8_regs;
typedef struct {
} La_i86_regs;
#endif
#if !defined(_SYS_INT_TYPES_H)
typedef unsigned long uintptr_t;
#else
typedef unsigned int uintptr_t;
#endif
#endif
#ifdef __STDC__
extern void la_preinit(uintptr_t *);
uint_t);
#if defined(_LP64)
const char *);
const char *);
#else /* !defined(_LP64) */
#endif /* _LP64 */
#else /* __STDC__ */
extern uint_t la_version();
extern void la_preinit();
extern uint_t la_objopen();
extern uint_t la_objclose();
extern int la_objfilter();
#if defined(_LP64)
extern uintptr_t la_sparcv9_pltenter();
extern uintptr_t la_pltexit64();
extern uintptr_t la_symbind64();
#else /* _ILP32 */
extern uintptr_t la_sparcv8_pltenter();
extern uintptr_t la_i86_pltenter();
extern uintptr_t la_pltexit();
extern uintptr_t la_symbind32();
#endif /* _LP64 */
#endif /* __STDC__ */
#endif /* _ASM */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _LINK_H */