/*
* 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 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_ELF_H
#define _SYS_ELF_H
#include <sys/elftypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* "Enumerations" below use ...NUM as the number of
* values in the list. It should be 1 greater than the
* highest "real" value.
*/
/*
* ELF header
*/
typedef struct {
} Elf32_Ehdr;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf64_Ehdr;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/* Argonaut Technologies Inc. */
/* embedded processor family */
/* microcontroller */
/* microcontroller */
/* microcontroller */
/* embedded processor */
/* embedded processor */
/* 64-bit processor */
/* machine-independent */
/* object files */
/*
* Program header
*/
typedef struct {
} Elf32_Phdr;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf64_Phdr;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/*
* PT_SUNW_UNWIND and PT_SUNW_EH_FRAME perform the same function,
* providing access to the .eh_frame_hdr section of the object.
* PT_SUNW_UNWIND is the original value, while PT_SUNW_EH_FRAME is
* required by the amd64 psABI. The Solaris link-editor (ld) tags output
* objects with PT_SUNW_UNWIND, but the Solaris runtime linker (ld.so.1)
* will accept and use either value.
*/
/*
* Linux specific program headers not currently used by Solaris
*/
/*
* Section header
*/
typedef struct {
} Elf32_Shdr;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf64_Shdr;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/* Solaris ABI specific values */
/*
* Due to the overlap in assigned values with the Solaris OSABI, correct
* interpretation of these values requires knowledge of the OSABI used by
* the object.
*/
/*
* Symbol table
*/
typedef struct {
unsigned char st_other;
} Elf32_Sym;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
unsigned char st_other;
} Elf64_Sym;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
#define STN_UNDEF 0
/*
* Macros to compose and decompose values for S.st_info
*
* bind = ELF32_ST_BIND(S.st_info)
* type = ELF32_ST_TYPE(S.st_info)
* S.st_info = ELF32_ST_INFO(bind, type)
*/
/*
* Macros to decompose values for S.st_other
*
* visibility = ELF32_ST_VISIBILITY(S.st_other)
*/
#define STV_DEFAULT 0
/*
* Relocation
*/
typedef struct {
} Elf32_Rel;
typedef struct {
} Elf32_Rela;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf64_Rel;
typedef struct {
} Elf64_Rela;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/*
* Macros to compose and decompose values for Rel.r_info, Rela.f_info
*
* sym = ELF32_R_SYM(R.r_info)
* type = ELF32_R_TYPE(R.r_info)
* R.r_info = ELF32_R_INFO(sym, type)
*/
/*
* The r_info field is composed of two 32-bit components: the symbol
* table index and the relocation type. The relocation type for SPARC V9
* is further decomposed into an 8-bit type identifier and a 24-bit type
* dependent data field. For the existing Elf32 relocation types,
* that data field is zero.
*/
/*
* Section Group Flags (SHT_GROUP)
*/
/*
* Note entry header
*/
typedef struct {
} Elf32_Nhdr;
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf64_Nhdr;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/*
* Move entry
*/
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
} Elf32_Move;
/*
* Macros to compose and decompose values for Move.r_info
*
* sym = ELF32_M_SYM(M.m_info)
* size = ELF32_M_SIZE(M.m_info)
* M.m_info = ELF32_M_INFO(sym, size)
*/
typedef struct {
} Elf64_Move;
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
/*
* Capabilities entry, Capabilities info and Capabilities chain.
*/
#ifndef _ASM
typedef struct {
union {
} c_un;
} Elf32_Cap;
/*
* Macros to compose and decompose values for capabilities info.
*
* sym = ELF32_C_SYM(info)
* grp = ELF32_C_GROUP(info)
* info = ELF32_C_INFO(sym, grp)
*/
#if defined(_LP64) || defined(_LONGLONG_TYPE)
typedef struct {
union {
} c_un;
} Elf64_Cap;
/*
* Macros to compose and decompose values for capabilities info.
*
* sym = ELF64_C_SYM(info)
* grp = ELF64_C_GROUP(info)
* info = ELF64_C_INFO(sym, grp)
*/
#endif /* defined(_LP64) || defined(_LONGLONG_TYPE) */
#endif
/*
* Version numbers for SHT_SUNW_capinfo and SHT_SUNW_capchain.
*/
#define CAPINFO_NONE 0
#define CAPCHAIN_NONE 0
/*
* A SHT_SUNW_capinfo table mirrors a symbol table. A capabilities symbol has
* a SHT_SUNW_capinfo table entry that provides an index into the associated
* SHT_SUNW_cap capabilities group, and the symbol index of the associated lead
* symbol. A capabilities symbol is a local symbol. A global lead capabilities
* symbol is tagged with a group CAPINFO_SUNW_GLOB.
*/
/*
* Capabilities values.
*/
#define CA_SUNW_NULL 0
/*
* Define software capabilities (CA_SUNW_SF_1 values). Note, hardware
*/
/*
* Known values for note entry types (e_type == ET_CORE)
*/
#ifdef _KERNEL
/*
* The following routine checks the processor-specific
* fields of an ELF header.
*/
#endif
#ifdef __cplusplus
}
#endif
#if defined(ELF_TARGET_ALL) || defined(ELF_TARGET_SPARC)
#include <sys/elf_SPARC.h>
#endif
#if defined(ELF_TARGET_ALL) || defined(ELF_TARGET_386)
#endif
#if defined(ELF_TARGET_ALL) || defined(ELF_TARGET_AMD64)
#include <sys/elf_amd64.h>
#endif
#endif /* _SYS_ELF_H */