dynamic.c revision dffec89c701f362367e5e044605265b4dede5a69
/*
* 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.
*/
#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 MSG_GBL_OSQBRKT_SIZE + \
const char *
{
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
if (flags & DF_P1_LAZYLOAD)
if (flags & DF_P1_GROUPPERM)
return ((const char *)string);
}
#define FLAGSZ MSG_DF_ORIGIN_SIZE + \
const char *
{
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
else {
if (flags & DF_SYMBOLIC)
if (flags & DF_TEXTREL)
if (flags & DF_BIND_NOW)
if (flags & DF_STATIC_TLS)
return ((const char *)string);
}
}
#define FLAG1SZ MSG_GBL_OSQBRKT_SIZE + \
MSG_DF1_NOW_SIZE + \
const char *
{
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
else {
if (flags & DF_1_GROUP)
if (flags & DF_1_NODELETE)
if (flags & DF_1_LOADFLTR)
if (flags & DF_1_INITFIRST)
if (flags & DF_1_NOOPEN)
if (flags & DF_1_ORIGIN)
if (flags & DF_1_DIRECT)
if (flags & DF_1_TRANS)
if (flags & DF_1_INTERPOSE)
if (flags & DF_1_NODEFLIB)
if (flags & DF_1_NODUMP)
if (flags & DF_1_CONFALT)
if (flags & DF_1_ENDFILTEE)
if (flags & DF_1_DISPRELPND)
if (flags & DF_1_DISPRELDNE)
if (flags & DF_1_NODIRECT)
if (flags & DF_1_IGNMULDEF)
if (flags & DF_1_NOKSYMS)
if (flags & DF_1_NORELOC)
return ((const char *)string);
}
}
#define FEATSZ MSG_GBL_OSQBRKT_SIZE + \
const char *
{
if (flags == 0)
return (MSG_ORIG(MSG_GBL_ZERO));
else {
if (flags & DTF_1_PARINIT)
if (flags & DTF_1_CONFEXP)
return ((const char *)string);
}
}
};
const char *
{
if (tag < DT_MAXPOSTAGS) {
/*
* Generic dynamic tags.
*/
} 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));
/*
* 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 BINDESZ MSG_GBL_OSQBRKT_SIZE + \
const char *
{
/*
* Evaluate the binding descriptors flags.
*/
if (flags) {
if (flags & BND_NEEDED)
if (flags & BND_FILTER)
return ((const char *)string);
} else
return (MSG_ORIG(MSG_STR_EMPTY));
}
#define BINDSSZ MSG_GBL_OSQBRKT_SIZE + \
const char *
{
/*
* Evaluate the binding descriptors flags.
*/
if (flags) {
if (flags & LML_FLG_OBJADDED)
if (flags & LML_FLG_OBJREEVAL)
if (flags & LML_FLG_OBJDELETED)
if (flags & LML_FLG_ATEXIT)
return ((const char *)string);
} else
return (MSG_ORIG(MSG_STR_EMPTY));
}