sections.c revision 08278a5e91755ccdb5850c19d21d42fb2e16b50e
/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* String conversion routines for section attributes.
*/
#include <string.h>
#include <sys/elf_SPARC.h>
#include <sys/elf_amd64.h>
#include <_conv.h>
#include <sections_msg.h>
static const conv_ds_t **
{
/*
* This routine can return an array with 1 generic array, up to
* three osabi arrays, two machine arrays, plus the NULL termination.
*/
#define MAX_RET 7
};
};
};
};
#error "SHT_NUM has grown"
#endif
static const conv_ds_msg_t ds_secs_def = {
static const conv_ds_msg_t ds_secs_dmp = {
static const conv_ds_msg_t ds_secs_cf = {
static const conv_ds_msg_t ds_secs_nf = {
};
};
};
};
#if (SHT_LOSUNW != SHT_SUNW_capchain)
#error "SHT_LOSUNW has moved"
#endif
static const conv_ds_msg_t ds_usecs_def = {
static const conv_ds_msg_t ds_usecs_dmp = {
static const conv_ds_msg_t ds_usecs_cf = {
static const conv_ds_msg_t ds_usecs_nf = {
/* The Linux osabi range has two separate sequences */
static const Msg usecs_gnu1_def[] = {
};
static const Msg usecs_gnu1_dmp[] = {
};
static const Msg usecs_gnu1_cf[] = {
};
static const Msg usecs_gnu1_nf[] = {
};
static const conv_ds_msg_t ds_usecs_gnu1_def = {
static const conv_ds_msg_t ds_usecs_gnu1_dmp = {
static const conv_ds_msg_t ds_usecs_gnu1_cf = {
static const conv_ds_msg_t ds_usecs_gnu1_nf = {
static const Msg usecs_gnu2_def[] = {
};
static const Msg usecs_gnu2_dmp[] = {
};
static const Msg usecs_gnu2_cf[] = {
};
static const Msg usecs_gnu2_nf[] = {
};
static const conv_ds_msg_t ds_usecs_gnu2_def = {
static const conv_ds_msg_t ds_usecs_gnu2_dmp = {
static const conv_ds_msg_t ds_usecs_gnu2_cf = {
static const conv_ds_msg_t ds_usecs_gnu2_nf = {
/* sparc processor range */
static const conv_ds_msg_t ds_sparc_def = {
static const conv_ds_msg_t ds_sparc_dmp = {
static const conv_ds_msg_t ds_sparc_cf = {
static const conv_ds_msg_t ds_sparc_nf = {
/* amd64 processor range */
static const conv_ds_msg_t ds_amd64_def = {
static const conv_ds_msg_t ds_amd64_dmp = {
static const conv_ds_msg_t ds_amd64_cf = {
static const conv_ds_msg_t ds_amd64_nf = {
int retndx = 0;
/* Select the strings to use, based on string style and OSABI */
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
break;
case CONV_FMT_ALT_CF:
break;
case CONV_FMT_ALT_NF:
break;
default:
break;
}
(osabi == CONV_OSABI_ALL)) {
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
break;
case CONV_FMT_ALT_CF:
break;
case CONV_FMT_ALT_NF:
break;
default:
break;
}
}
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
break;
case CONV_FMT_ALT_CF:
break;
case CONV_FMT_ALT_NF:
break;
default:
break;
}
}
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
break;
case CONV_FMT_ALT_CF:
break;
case CONV_FMT_ALT_NF:
break;
default:
break;
}
}
switch (CONV_TYPE_FMT_ALT(fmt_flags)) {
case CONV_FMT_ALT_DUMP:
break;
case CONV_FMT_ALT_CF:
break;
case CONV_FMT_ALT_NF:
break;
default:
break;
}
}
return (retarr);
}
const char *
{
}
{
}
/*
* Special iteration routine that returns strings for all symbol table
* sections.
*/
{
{ SHT_SYMTAB, 0, 0, MSG_SHT_SYMTAB_CF },
{ SHT_DYNSYM, 0, 0, MSG_SHT_DYNSYM_CF },
{ SHT_SUNW_LDYNSYM, ELFOSABI_SOLARIS, 0,
{ 0 }
};
{ SHT_SYMTAB, 0, 0, MSG_SHT_SYMTAB_NF },
{ SHT_DYNSYM, 0, 0, MSG_SHT_DYNSYM_NF },
{ SHT_SUNW_LDYNSYM, ELFOSABI_SOLARIS, 0,
{ 0 }
};
}
const Val_desc2 *
{
#define FLAGSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
/*
* Ensure that Conv_sec_flags_buf_t is large enough:
*
* FLAGSZ is the real minimum size of the buffer required by
* conv_sec_flags(). However, Conv_sec_flags_buf_t uses
* CONV_SEC_FLAGS_BUFSIZE to set the buffer size. We do things this
* way because the definition of FLAGSZ uses information that is not
* available in the environment of other programs that include the
* conv.h header file.
*/
#define REPORT_BUFSIZE FLAGSZ
#include "report_bufsize.h"
#error "CONV_SEC_FLAGS_BUFSIZE does not match FLAGSZ"
#endif
{ 0, 0 }
};
{ 0, 0 }
};
}
{
static const conv_ds_msg_t ds_msg_amd64_alias_cf = {
static const conv_ds_t *ds_amd64_alias_cf[] = {
static const conv_ds_msg_t ds_msg_amd64_alias_nf = {
static const conv_ds_t *ds_amd64_alias_nf[] = {
return (CONV_ITER_DONE);
/* SHF_AMD64_LARGE is also known as SHF_X86_64_LARGE */
}
return (CONV_ITER_CONT);
}