_elfdump.h revision 39773e466ff90ce703d7f52f3267d7e96c09c6f5
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef __ELFDUMP_H
#define __ELFDUMP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <machelf.h>
#include <debug.h>
/*
* Local include file for elfdump.
*/
#ifdef __cplusplus
extern "C" {
#endif
#define FLG_DYNAMIC 0x00000001
#define FLG_EHDR 0x00000002
#define FLG_INTERP 0x00000004
#define FLG_SHDR 0x00000008
#define FLG_NOTE 0x00000010
#define FLG_PHDR 0x00000020
#define FLG_RELOC 0x00000040
#define FLG_SYMBOLS 0x00000080
#define FLG_VERSIONS 0x00000100
#define FLG_HASH 0x00000200
#define FLG_GOT 0x00000400
#define FLG_SYMINFO 0x00000800
#define FLG_MOVE 0x00001000
#define FLG_GROUP 0x00002000
#define FLG_CAP 0x00004000
#define FLG_UNWIND 0x00008000
#define FLG_SORT 0x00010000
#define FLG_EVERYTHING 0x000fffff
#define MAXNDXSIZE 10
typedef struct cache {
char *c_name;
int c_ndx; /* Section index */
} Cache;
typedef struct got_info {
/* support mixed relocations */
void *g_rel;
const char *g_symname;
} Got_info;
extern const Cache cache_init;
extern void failure(const char *, const char *);
extern int match(int, const char *, int);
/*
* Define various elfdump() functions into their 32-bit and 64-bit variants.
*/
#if defined(_ELF64)
#define checksum checksum64
#define fake_shdr_cache fake_shdr_cache64
#define note_entry note_entry64
#define sections sections64
#define symlookup symlookup64
#define versions versions64
#define version_def version_def64
#define version_need version_need64
#else
#define checksum checksum32
#define fake_shdr_cache fake_shdr_cache32
#define note_entry note_entry32
#define sections sections32
#define symlookup symlookup32
#define versions versions32
#define version_def version_def32
#define version_need version_need32
#endif
#ifdef __cplusplus
}
#endif
#endif /* __ELFDUMP_H */