dynamic.c revision 2926dd2e801916128855cec712d18656be9bd1c5
/*
* 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 2006 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"
#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;
};
};
if (tag < DT_MAXPOSTAGS) {
/*
* Generic dynamic tags.
*/
return ((fmt_flags & CONV_FMTALTMASK)
} else {
/*
* SUNW: DT_LOOS -> DT_HIOS range.
*/
if (tag == DT_SUNW_AUXILIARY)
return (MSG_ORIG(MSG_DYN_SUNW_AUXILIARY));
else if (tag == DT_SUNW_RTLDINF)
return (MSG_ORIG(MSG_DYN_SUNW_RTLDINF));
else if (tag == DT_SUNW_FILTER)
return (MSG_ORIG(MSG_DYN_SUNW_FILTER));
else if (tag == DT_SUNW_CAP)
return (MSG_ORIG(MSG_DYN_SUNW_CAP));
else if (tag == DT_SUNW_SYMTAB)
return (MSG_ORIG(MSG_DYN_SUNW_SYMTAB));
else if (tag == DT_SUNW_SYMSZ)
return (MSG_ORIG(MSG_DYN_SUNW_SYMSZ));
/*
* SUNW: DT_VALRNGLO - DT_VALRNGHI range.
*/
else if (tag == DT_CHECKSUM)
return (MSG_ORIG(MSG_DYN_CHECKSUM));
else if (tag == DT_PLTPADSZ)
return (MSG_ORIG(MSG_DYN_PLTPADSZ));
else if (tag == DT_MOVEENT)
return (MSG_ORIG(MSG_DYN_MOVEENT));
return (MSG_ORIG(MSG_DYN_MOVESZ));
else if (tag == DT_FEATURE_1)
return (MSG_ORIG(MSG_DYN_FEATURE_1));
else if (tag == DT_POSFLAG_1)
return (MSG_ORIG(MSG_DYN_POSFLAG_1));
else if (tag == DT_SYMINSZ)
return (MSG_ORIG(MSG_DYN_SYMINSZ));
else if (tag == DT_SYMINENT)
return (MSG_ORIG(MSG_DYN_SYMINENT));
/*
* SUNW: DT_ADDRRNGLO - DT_ADDRRNGHI range.
*/
return (MSG_ORIG(MSG_DYN_CONFIG));
else if (tag == DT_DEPAUDIT)
return (MSG_ORIG(MSG_DYN_DEPAUDIT));
return (MSG_ORIG(MSG_DYN_AUDIT));
return (MSG_ORIG(MSG_DYN_PLTPAD));
else if (tag == DT_MOVETAB)
return (MSG_ORIG(MSG_DYN_MOVETAB));
else if (tag == DT_SYMINFO)
return (MSG_ORIG(MSG_DYN_SYMINFO));
/*
* SUNW: generic range.
*/
return (MSG_ORIG(MSG_DYN_VERSYM));
else if (tag == DT_RELACOUNT)
return (MSG_ORIG(MSG_DYN_RELACOUNT));
else if (tag == DT_RELCOUNT)
return (MSG_ORIG(MSG_DYN_RELCOUNT));
else if (tag == DT_FLAGS_1)
return (MSG_ORIG(MSG_DYN_FLAGS_1));
return (MSG_ORIG(MSG_DYN_VERDEF));
else if (tag == DT_VERDEFNUM)
return (MSG_ORIG(MSG_DYN_VERDEFNUM));
else if (tag == DT_VERNEED)
return (MSG_ORIG(MSG_DYN_VERNEED));
else if (tag == DT_VERNEEDNUM)
return (MSG_ORIG(MSG_DYN_VERNEEDNUM));
else if (tag == DT_AUXILIARY)
return (MSG_ORIG(MSG_DYN_AUXILIARY));
return (MSG_ORIG(MSG_DYN_USED));
return (MSG_ORIG(MSG_DYN_FILTER));
/*
* SUNW: machine specific range.
*/
/* this is so x86 can display a sparc binary */
return (MSG_ORIG(MSG_DYN_REGISTER));
else if (tag == DT_DEPRECATED_SPARC_REGISTER)
return (MSG_ORIG(MSG_DYN_REGISTER));
else
}
}
#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);
}