/*
* 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 2014 Garrett D'Amore <garrett@damore.org>
*/
#ifndef _LINK_H
#define _LINK_H
#ifndef _ASM
#include <elf.h>
#include <dlfcn.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
/*
* ld support library calls.
*
* These cannot be used in a 32bit large file capable environment because
* libelf is not large-file safe. Only define these interfaces if we are not
* 32bit, or not in the large file environment.
*/
#include <libelf.h>
extern void ld_input_done(uint_t *);
extern void ld_start(const char *, const Elf32_Half, const char *);
extern void ld_atexit(int);
#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) */
#endif /* !defined(_ILP32) || _FILE_OFFSET_BITS != 64 */
/*
* ld_version() version values.
*/
#define LD_SUP_VNONE 0
/*
* Flags passed to ld support calls.
*/
#endif
/*
* Runtime link-map identifiers.
*/
/*
* Runtime Link-Edit Auditing.
*/
#define LAV_NONE 0
/*
* 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 {
#else
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
extern void la_preinit(uintptr_t *);
uint_t);
#if defined(_LP64)
const char *);
const char *);
#else /* !defined(_LP64) */
#endif /* _LP64 */
/*
* the dl_phdr_info structure used by dl_phdr_iterate(), which also
* originated under Linux. Given an ELF data type, without the ElfXX_
* prefix, it supplies the appropriate prefix (Elf32_ or Elf64_) for
* the ELFCLASS of the code being compiled.
*
* Note that ElfW() is not suitable in situations in which the ELFCLASS
* of the code being compiled does not match that of the objects that
* code is intended to operate on (e.g. a 32-bit link-editor building
* recommended in such cases.
*/
#ifdef _LP64
#else
#endif
/*
* The callback function to dl_interate_phdr() receives a pointer
* to a structure of this type.
*
* dlpi_addr is defined such that the address of any segment in
* the program header array can be calculated as:
*
* addr == info->dlpi_addr + info->dlpi_phdr[x].p_vaddr;
*
* It is therefore 0 for ET_EXEC objects, and the base address at
* which the object is mapped otherwise.
*/
struct dl_phdr_info {
/*
* Note: Following members were introduced after the first version
* of this structure was available. The dl_iterate_phdr() callback
* function is passed a 'size' argument giving the size of the info
* structure, and must compare that size to the offset of these fields
* before accessing them to ensure that they are present.
*/
/* Incremented when a new object is mapped into the process */
/* Incremented when an object is unmapped from the process */
};
void *);
#endif /* _ASM */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _LINK_H */