libelf.h revision 62b628a68db596a2d75a316dc7ffef658079231f
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBELF_H
#define _LIBELF_H
#ifdef __cplusplus
extern "C" {
#endif
#error "large files are not supported by libelf"
#endif
#undef _
#ifdef __STDC__
typedef void Elf_Void;
#define _(a) a
#else
typedef char Elf_Void;
#define _(a) ()
#undef const
#define const
#endif
/*
* Commands
*/
typedef enum {
ELF_C_NULL = 0, /* must be first, 0 */
ELF_C_NUM /* must be last */
} Elf_Cmd;
/*
* Flags
*/
#define ELF_F_DIRTY 0x1
#define ELF_F_LAYOUT 0x4
/*
* File types
*/
typedef enum {
ELF_K_NONE = 0, /* must be first, 0 */
ELF_K_NUM /* must be last */
} Elf_Kind;
/*
* Translation types
*/
typedef enum {
ELF_T_BYTE = 0, /* must be first, 0 */
ELF_T_NUM /* must be last */
} Elf_Type;
/*
* Archive member header
*/
typedef struct {
char *ar_name;
char *ar_rawname;
} Elf_Arhdr;
/*
* Archive symbol table
*/
typedef struct {
char *as_name;
unsigned long as_hash;
} Elf_Arsym;
/*
* Data descriptor
*/
typedef struct {
unsigned d_version; /* elf version */
} Elf_Data;
/*
* Function declarations
*/
const char *elf_errmsg _((int));
int elf_errno _((void));
void elf_fill _((int));
unsigned long elf_hash _((const char *));
uint_t elf_sys_encoding _((void));
long elf32_checksum _((Elf *));
unsigned elf_version _((unsigned));
#if defined(_LP64) || defined(_LONGLONG_TYPE)
long elf64_checksum _((Elf *));
#endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */
#undef _
#ifdef __cplusplus
}
#endif
#endif /* _LIBELF_H */