dynamic.c revision 02ca3e029e37aa98ac6717698bfdac6afe960932
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* String conversion routine for .dynamic tag entries.
*/
#include <stdio.h>
#include <string.h>
#include <sys/elf_SPARC.h>
#include "rtld.h"
#include "_conv.h"
#include "dynamic_msg.h"
/* Instantiate a local copy of conv_map2str() from _conv.h */
#define POSSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
{ 0, 0 }
};
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
(void) conv_expn_field(arg);
return ((const char *)string);
}
#define FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
if (fmt_flags & CONV_FMT_ALTDUMP) {
} else {
}
(void) conv_expn_field(&conv_arg);
return ((const char *)string);
}
#define FLAG1SZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
(void) conv_expn_field(&conv_arg);
return ((const char *)string);
}
#define FEATSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
if (fmt_flags & CONV_FMT_ALTDUMP) {
} else {
}
(void) conv_expn_field(&conv_arg);
return ((const char *)string);
}
const char *
{
static Conv_inv_buf_t string;
/*
* Dynamic tag values are sparse, cover a wide range, and have
* holes. To handle this efficiently, we fall through a series
* of tests below, in increasing tag order, returning at the first
* match.
*
* If we fall all the way to the end, the tag is unknown,
* and its numeric value is printed.
*/
/*
* Most of the tag values are clustered in contiguous ranges.
* Each contiguous range of defined values is handled with
* an array that contains the message index corresponding to
* each value in that range. The DYN_RANGE macro checks the
* tag value against range of values starting at _start_tag.
* If there is a match, the index of the appropriate name is
* pulled from _array and returned to the caller.
*/
/*
* Generic dynamic tags:
* - Note hole between DT_FLAGS and DT_PREINIT_ARRAY
* - The first range has alternative names for dump,
* requiring a second array.
*/
};
static const Msg tags_null_alt[] = {
};
static const Msg tags_preinit_array[] = {
};
/*
* SUNW: DT_LOOS -> DT_HIOS range.
*/
static const Msg tags_sunw_auxiliary[] = {
};
/*
* SUNW: DT_VALRNGLO - DT_VALRNGHI range.
*/
static const Msg tags_checksum[] = {
};
/*
* SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
*/
static const Msg tags_config[] = {
};
/*
* SUNW: generic range. Note hole between DT_VERSYM and DT_RELACOUNT.
* We handle DT_VERSYM as a single value below.
*/
static const Msg tags_relacount[] = {
};
/*
* DT_LOPROC - DT_HIPROC range.
*/
static const Msg tags_auxiliary[] = {
};
tags_null_alt, NULL));
return (MSG_ORIG(MSG_DYN_VERSYM));
/*
* SUNW: machine specific range.
*/
/* this is so x86 can display a sparc binary */
return (MSG_ORIG(MSG_DYN_REGISTER));
if (tag == DT_DEPRECATED_SPARC_REGISTER)
return (MSG_ORIG(MSG_DYN_REGISTER));
/* Unknown item */
}
#define BINDTSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
if (flags == 0)
return (MSG_ORIG(MSG_STR_EMPTY));
(void) conv_expn_field(&conv_arg);
return ((const char *)string);
}
/*
* Note, conv_bnd_obj() is called with either:
* LML_FLG_OBJADDED (possibly with LML_FLG_OBJREEVAL added), or
* LML_FLG_OBJDELETED, or
* LML_FLG_ATEXIT.
*/
#define BINDOSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
const char *
{
{ 0, 0 }
};
LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
return (MSG_ORIG(MSG_BND_REVISIT));
/*
* Note, we're not worried about unknown flags for this family, only
* the selected flags are of interest, so we leave conv_arg.rflags
* set to 0.
*/
(void) conv_expn_field(&conv_arg);
return ((const char *)string);
}