elf.c revision bebb829deac32e16136b725d421267d3dceb6cfd
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* String conversion routines for ELF header attributes.
*/
#include <stdio.h>
#include <string.h>
#include "_conv.h"
#include "elf_msg.h"
#include <sys/elf_SPARC.h>
/* Instantiate a local copy of conv_map2str() from _conv.h */
const char *
{
};
static const Msg classes_alt[] = {
};
/* Use alternative strings? */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
}
/* Use default strings */
}
const char *
{
};
static const Msg datas_dump[] = {
};
static const Msg datas_file[] = {
};
/* Use alternative strings? */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
}
/* Use default strings */
}
};
};
#error "EM_NUM has grown"
#endif
const char *
{
/* Use alternative strings? */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
}
/* Use default strings */
}
const char *
{
};
static const Msg etypes_alt[] = {
};
if (etype == ET_SUNWPSEUDO) {
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
return (MSG_ORIG(MSG_ET_SUNWPSEUDO_ALT));
default:
return (MSG_ORIG(MSG_ET_SUNWPSEUDO));
}
}
/* Use alternative strings? */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
}
/* Use default strings */
}
const char *
{
};
static const Msg versions_alt[] = {
};
/* Use alternative strings? */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
}
/* Use default strings */
}
#define EFLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
/*
* Ensure that Conv_ehdr_flags_buf_t is large enough:
*
* EFLAGSZ is the real minimum size of the buffer required by conv_ehdr_flags().
* However, Conv_ehdr_flags_buf_t uses CONV_EHDR_FLAG_BUFSIZE to set the
* buffer size. We do things this way because the definition of EFLAGSZ uses
* information that is not available in the environment of other programs
* that include the conv.h header file.
*/
#define REPORT_BUFSIZE EFLAGSZ
#include "report_bufsize.h"
#error "CONV_EHDR_FLAGS_BUFSIZE does not match EFLAGSZ"
#endif
/*
* Make a string representation of the e_flags field.
*/
const char *
{
{ 0, 0 }
};
};
static const char *leading_str_arr[2];
static CONV_EXPN_FIELD_ARG conv_arg = {
const char **lstr = leading_str_arr;
/*
* Non-SPARC architectures presently provide no known flags.
*/
/*
* Valid vendor extension bits for SPARCV9. These must be
* updated along with elf_SPARC.h.
*/
}
}
}
/*
* Make a string representation of the e_ident[EI_OSABI] field.
*/
const char *
{
};
static const Msg osabi_arr_alt[] = {
};
const char *str;
switch (osabi) {
case ELFOSABI_ARM:
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
break;
default:
}
break;
case ELFOSABI_STANDALONE:
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
break;
default:
}
break;
default:
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
break;
default:
}
break;
}
return (str);
}
/*
* A generic means of returning additional information for a rejected file in
* terms of a string.
*/
const char *
{
switch (type) {
case SGS_REJ_MACH:
&reject_desc_buf->inv_buf));
case SGS_REJ_CLASS:
&reject_desc_buf->inv_buf));
case SGS_REJ_DATA:
&reject_desc_buf->inv_buf));
case SGS_REJ_TYPE:
&reject_desc_buf->inv_buf));
case SGS_REJ_BADFLAG:
case SGS_REJ_MISFLAG:
case SGS_REJ_HAL:
case SGS_REJ_US3:
&reject_desc_buf->flags_buf));
case SGS_REJ_UNKFILE:
return ((const char *)0);
case SGS_REJ_STR:
case SGS_REJ_HWCAP_1:
case SGS_REJ_SFCAP_1:
else
return (MSG_ORIG(MSG_STR_EMPTY));
default:
}
}