reloc.h revision 552ff45744b184a9b5515fb45ac67b5502db607c
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RELOC_DOT_H
#define _RELOC_DOT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#if defined(_KERNEL)
#include <sys/bootconf.h>
#include <sys/kobj_impl.h>
#else
#include <machdep.h>
#include <conv.h>
#endif /* _KERNEL */
#include <relmach.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Global include file for relocation common code.
*
* Flags for reloc_entry->re_flags
*/
#define FLG_RE_NOTREL 0x00000000
#define FLG_RE_PCREL 0x00000010
#define FLG_RE_PLTREL 0x00000020
/* required for non-fixed */
/* objects */
/* a REGISTER by OLO10 */
/* locally */
/*
* Macros for testing relocation table flags
*/
extern const Rel_entry reloc_table[];
FLG_RE_PLTREL) != 0)
FLG_RE_GOTADD) != 0)
FLG_RE_GOTPC) != 0)
(FLG_RE_GOTPC | FLG_RE_GOTADD)) == \
FLG_RE_GOTREL) != 0)
FLG_RE_GOTOPINS) != 0)
FLG_RE_PCREL) != 0)
FLG_RE_ADDRELATIVE) != 0)
FLG_RE_REGISTER) != 0)
FLG_RE_FRMOFF) != 0)
FLG_RE_NOTSUP) != 0)
FLG_RE_SEGREL) != 0)
FLG_RE_EXTOFFSET) != 0)
FLG_RE_SECREL) != 0)
FLG_RE_TLSINS) != 0)
FLG_RE_TLSGD) != 0)
FLG_RE_TLSLD) != 0)
FLG_RE_TLSIE) != 0)
FLG_RE_TLSLE) != 0)
FLG_RE_TLSLE)) != 0)
FLG_RE_LOCLBND) != 0)
/*
* Functions.
*/
const char *);
/*
* Provide a macro to select the appropriate convension routine for this
* architecture.
*/
#if defined(__amd64)
#else
#endif
#if defined(_KERNEL)
/*
* These are macro's that are only needed for krtld. Many of these are already
*/
/*
* Message strings used by doreloc().
*/
#define MSG_STR_UNKNOWN "(unknown)"
#define MSG_REL_PREGEN "relocation error: %s: "
#define MSG_REL_PREFIL "relocation error: file %s: "
#define MSG_REL_FILE "file %s: "
#define MSG_REL_SYM "symbol %s: "
#define MSG_REL_VALUE "value 0x%llx "
#define MSG_REL_LOSEBITS "loses %d bits at "
#define MSG_REL_UNIMPL "unimplemented relocation type: %d"
#define MSG_REL_UNSUPSZ "offset size (%d bytes) is not supported"
#define MSG_REL_NONALIGN "offset 0x%llx is non-aligned"
#define MSG_REL_UNNOBITS "unsupported number of bits: %d"
#define MSG_REL_OFFSET "offset 0x%llx"
#define MSG_REL_NOFIT "value 0x%llx does not fit"
extern const char *conv_reloc_386_type_str(uint_t);
extern const char *conv_reloc_amd64_type_str(uint_t);
extern const char *conv_reloc_SPARC_type_str(uint_t);
/*
* Note: Related to bug 4128755, dlerror() only keeps track of a single error
* string, and therefore must have errors reported through a single eprintf()
* call. The kernel's _kobj_printf is somewhat more limited, and must receive
* messages with only one arguement to the format string. The following macros
* are to straighted all this out because krtld and rtld share do_reloc().
*/
#else /* !_KERNEL */
extern const char *demangle(const char *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _RELOC_DOT_H */