/*
* 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
*/
/*
*/
/*
* 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>
static const conv_ds_t **
{
};
};
};
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
return (ds_dump);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
const char *
{
}
void *uvalue)
{
}
static const conv_ds_t **
{
};
};
};
};
NULL };
NULL };
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
return (ds_dump);
case CONV_FMT_ALT_FILE:
return (ds_file);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
const char *
{
}
void *uvalue)
{
}
static const conv_ds_t **
{
};
};
};
};
};
};
};
};
};
};
};
};
#error "EM_NUM has grown"
#endif
/* Build NULL terminated return arrays for each string style */
};
};
};
/* Select the strings to use */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
case CONV_FMT_ALT_FILE:
return (ds_dmp);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
const char *
{
}
void *uvalue)
{
{ EM_M32, MSG_EM_M32_DMP},
{ EM_386, MSG_EM_386_DMP },
{ EM_68K, MSG_EM_68K_DMP },
{ EM_88K, MSG_EM_88K_DMP },
{ EM_486, MSG_EM_486_DMP },
{ EM_860, MSG_EM_860_DMP },
{ EM_MIPS, MSG_EM_MIPS_DMP },
{ EM_PPC, MSG_EM_PPC_DMP },
{ EM_PPC64, MSG_EM_PPC64_DMP },
{ 0 }
};
return (CONV_ITER_DONE);
/*
* For the NF style, we also supply a few of the traditional
* dump versions for iteration, but not for display.
*/
return (CONV_ITER_CONT);
}
static const conv_ds_t **
{
};
};
error "EI_PAD has grown. Update etypes[]"
#endif
/* Build NULL terminated return arrays for each string style */
/* Select the strings to use */
}
void *uvalue)
{
}
static const conv_ds_t **
{
};
};
};
error "ET_NUM has grown. Update types[]"
#endif
{ 0 }
};
{ 0 }
};
{ 0 }
};
#if ET_LOSUNW != ET_SUNWPSEUDO
error "ET_LOSUNW has grown. Update type_osabi[]"
#endif
/* Build NULL terminated return arrays for each string style */
NULL };
NULL };
NULL };
/* Select the strings to use */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
return (ds_dmp);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
const char *
{
}
{
}
static const conv_ds_t **
{
};
};
};
#if EV_NUM != 2
error "EV_NUM has grown. Update versions[]"
#endif
/* Build NULL terminated return arrays for each string style */
/* Select the strings to use */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
return (ds_dmp);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
const char *
{
}
void *uvalue)
{
}
static void
{
/*
* 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.
*/
#include "report_bufsize.h"
#error "CONV_EHDR_FLAGS_BUFSIZE does not match EFLAGSZ"
#endif
};
};
{ 0 }
};
{ 0 }
};
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
default:
*mm_msg = &ds_mm_flags_cf;
break;
case CONV_FMT_ALT_NF:
*mm_msg = &ds_mm_flags_nf;
break;
}
}
/*
* Make a string representation of the e_flags field.
*/
const char *
{
const char **lstr;
/*
* Non-SPARC architectures presently provide no known flags.
*/
}
}
void *uvalue)
{
if (mach == EM_SPARCV9) {
return (CONV_ITER_DONE);
}
}
return (CONV_ITER_CONT);
}
static const conv_ds_t **
{
};
};
};
};
};
};
{ ELFOSABI_ARM, MSG_OSABI_ARM_CF },
{ 0 }
};
{ ELFOSABI_ARM, MSG_OSABI_ARM_NF },
{ 0 }
};
{ 0 }
};
/* Build NULL terminated return arrays for each string style */
/* Select the strings to use */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
return (ds_dmp);
case CONV_FMT_ALT_NF:
return (ds_nf);
}
return (ds_cf);
}
/*
* Make a string representation of the e_ident[EI_OSABI] field.
*/
const char *
{
}
void *uvalue)
{
return (CONV_ITER_DONE);
/*
* ELFOSABI_NONE might have been better named ELFOSABI_SYSV. For the
* CF and NF sytles, we supply that name for 0 in addition to NONE.
*/
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_CF:
ELFOSABI_NONE, uvalue));
case CONV_FMT_ALT_NF:
ELFOSABI_NONE, uvalue));
}
return (CONV_ITER_CONT);
}
static const conv_ds_t **
{
};
};
#if EAV_SUNW_NUM != 2
error "EAV_SUNW_NUM has grown. Update abiversions[]"
#endif
/* Build NULL terminated return arrays for each string style */
/* For non-Solaris OSABI, we don't have symbolic names */
/*
* Select the strings to use. This is a rare case where
* we don't treat ELFOSABI_NONE and ELFOSABI_SOLARIS
* as the same thing. We should never create a Solaris
* object tagged as ELFOSABI_NONE for which the abiversion
* is non-zero.
*/
return (ds_none);
}
const char *
{
}
{
}
/*
* A generic means of returning additional information for a rejected file in
* terms of a string. ELFOSABI_SOLARIS is assummed.
*/
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:
case SGS_REJ_ARCHIVE:
return (NULL);
case SGS_REJ_STR:
case SGS_REJ_HWCAP_1:
case SGS_REJ_SFCAP_1:
case SGS_REJ_HWCAP_2:
case SGS_REJ_MACHCAP:
case SGS_REJ_PLATCAP:
else
return (MSG_ORIG(MSG_STR_EMPTY));
default:
}
}