/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <ctype.h>
#include <elfedit.h>
#include <sys/elf_SPARC.h>
#include <sys/elf_amd64.h>
#include <strings.h>
#include <conv.h>
#include <debug.h>
#include <ehdr_msg.h>
/*
* This module handles changes to the ELF header
*/
/*
* This module uses shared code for several of the commands.
* It is sometimes necessary to know which specific command
* is active.
*/
typedef enum {
/* Dump command, used as module default to display ELF header */
/* Commands that correspond directly to ELF header fields */
/* Commands that correspond to the e_ident[] array in ELF hdr */
} EHDR_CMD_T;
#ifndef _ELF64
/*
* We supply this function for the msg module
*/
const char *
{
}
#endif
/*
* This function is supplied to elfedit through our elfedit_module_t
* definition. It translates the opaque elfedit_i18nhdl_t handles
* in our module interface into the actual strings for elfedit to
* use.
*
* note:
* This module uses Msg codes for its i18n handle type.
* So the translation is simply to use MSG_INTL() to turn
* it into a string and return it.
*/
static const char *
{
}
/*
* The ehdr_opt_t enum specifies a bit value for every optional
* argument allowed by a command in this module.
*/
typedef enum {
/* section, not name */
/* section, not name */
} ehdr_opt_t;
/*
* A variable of type ARGSTATE is used by each command to maintain
* information about the arguments and related things. It is
* initialized by process_args(), and used by the other routines.
*/
typedef struct {
} ARGSTATE;
/*
* Standard argument processing for ehdr module
*
* entry
* obj_state, argc, argv - Standard command arguments
* argstate - Address of ARGSTATE block to be initialized
*
* exit:
* On success, *argstate is initialized. On error,
* an error is issued and this routine does not return.
*/
static void
{
/* Add each new option to the options mask */
/* If there may be an arbitrary amount of output, use a pager */
if (argc == 0)
}
/*
* Format the given magic number byte into a buffer
*
* entry:
* value - Value of the magic value byte given by
* ehdr->ei_ident[EI_MAG?]
*/
static const char *
{
/*
* This routine can be called twice within a single C statement,
* so we use alternating buffers on each call to allow this
* without requiring the caller to supply a buffer (the size of
* which they don't know).
*/
static char *buf;
/* Switch buffers */
else
return (buf);
}
/*
* Print ELF header values, taking the calling command, and output style
* into account.
*
* entry:
* cmd - EHDR_CMD_T_* value giving identify of caller
* e_ident_ndx - Ignored unless cmd is EHDR_CMD_T_E_IDENT. In IDENT
* case, index of item in e_ident[] array to display, or
* -1 to display the entire array.
* autoprint - If True, output is only produced if the elfedit
* autoprint flag is set. If False, output is always produced.
* argstate - Argument state block
*/
static void
{
int c;
return;
/*
* Pick an output style. ehdr:dump is required to use the default
* style. The other commands use the current output style.
*/
if (cmd == EHDR_CMD_T_DUMP) {
} else {
outstyle = elfedit_outstyle();
/*
* When the caller specifies the simple output style,
* omit the brackets from around the values.
*/
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
/*
* For things that show a single header item, switch
* from default to simple mode.
*/
if ((outstyle == ELFEDIT_OUTSTYLE_DEFAULT) &&
}
/*
* If doing default output, use elfdump style where we
* show the full ELF header. In this case, the command
* that called us doesn't matter. This can only happen
* from ehdr:dump or ehdr:e_ident/
*/
if (outstyle == ELFEDIT_OUTSTYLE_DEFAULT) {
int i;
if (cmd == EHDR_CMD_T_DUMP) {
}
/*
* Elf_ehdr() does not display all of e_ident[], so we
* augment by displaying the entire array separately.
*/
for (i = 0; i < EI_NIDENT; i++) {
switch (i) {
case EI_MAG0:
case EI_MAG1:
case EI_MAG2:
case EI_MAG3:
ELFEDIT_CONST_EI, i, 1);
break;
case EI_CLASS:
0, &inv_buf);
break;
case EI_DATA:
0, &inv_buf);
break;
case EI_VERSION:
break;
case EI_OSABI:
0, &inv_buf);
break;
case EI_ABIVERSION:
break;
default:
break;
}
MSG_ORIG(MSG_FMT_BKTINT), i);
else
}
return;
}
switch (cmd) {
case EHDR_CMD_T_E_IDENT:
{
int i, cnt;
/* Show one element, or the entire thing? */
if (e_ident_ndx == -1) {
i = 0;
} else {
i = e_ident_ndx;
cnt = 1;
}
for (; cnt-- > 0; i++) {
/*
* If using numeric style, or there is
* no conversion routine for this item,
* print a simple hex value.
*/
if ((outstyle == ELFEDIT_OUTSTYLE_NUM) ||
(i > EI_ABIVERSION)) {
continue;
}
/* Handle special cases in simple mode */
switch (i) {
case EI_MAG0:
case EI_MAG1:
case EI_MAG2:
case EI_MAG3:
continue;
case EI_CLASS:
&inv_buf));
continue;
case EI_DATA:
&inv_buf));
continue;
case EI_VERSION:
&inv_buf));
continue;
case EI_OSABI:
&inv_buf));
continue;
case EI_ABIVERSION:
CONV_FMT_DECIMAL, &inv_buf));
continue;
}
}
}
return;
case EHDR_CMD_T_E_TYPE:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
else
return;
case EHDR_CMD_T_E_MACHINE:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE) {
} else {
}
return;
case EHDR_CMD_T_E_VERSION:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
else
return;
case EHDR_CMD_T_E_ENTRY:
return;
case EHDR_CMD_T_E_PHOFF:
return;
case EHDR_CMD_T_E_SHOFF:
return;
case EHDR_CMD_T_E_FLAGS:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE) {
flags_fmt_flags, &flags_buf));
} else {
}
return;
case EHDR_CMD_T_E_EHSIZE:
return;
case EHDR_CMD_T_E_PHENTSIZE:
return;
case EHDR_CMD_T_E_PHNUM:
{
/*
* If using extended indexes, fetch the real
* value from shdr[0].sh_info
*/
}
return;
case EHDR_CMD_T_E_SHENTSIZE:
return;
case EHDR_CMD_T_E_SHNUM:
{
/*
* If using extended indexes, fetch the real
* value from shdr[0].sh_size
*/
if (num == 0)
}
return;
case EHDR_CMD_T_E_SHSTRNDX:
{
/*
* If using extended indexes, fetch the real
* value from shdr[0].sh_link
*/
if (num == SHN_XINDEX)
}
return;
case EHDR_CMD_T_EI_MAG0:
case EHDR_CMD_T_EI_MAG1:
case EHDR_CMD_T_EI_MAG2:
case EHDR_CMD_T_EI_MAG3:
/* This depends on EHDR_CMD_T_EI_MAG[0-3] being contiguous */
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
conv_magic_value(c));
else
return;
case EHDR_CMD_T_EI_CLASS:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
conv_ehdr_class(c, 0, &inv_buf));
else
return;
case EHDR_CMD_T_EI_DATA:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
conv_ehdr_data(c, 0, &inv_buf));
else
return;
case EHDR_CMD_T_EI_VERSION:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE)
conv_ehdr_vers(c, 0, &inv_buf));
else
return;
case EHDR_CMD_T_EI_OSABI:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE) {
conv_ehdr_osabi(c, 0, &inv_buf));
} else {
EC_WORD(c));
}
return;
case EHDR_CMD_T_EI_ABIVERSION:
if (outstyle == ELFEDIT_OUTSTYLE_SIMPLE) {
c, CONV_FMT_DECIMAL, &inv_buf));
} else {
EC_WORD(c));
}
return;
}
}
/*
* Common body for the ehdr: module commands. These commands
* share a large amount of common behavior, so it is convenient
* to centralize things and use the cmd argument to handle the
* small differences.
*
* entry:
* cmd - One of the EHDR_CMD_T_* constants listed above, specifying
* which command to implement.
* obj_state, argc, argv - Standard command arguments
*/
static elfedit_cmdret_t
{
/*
* When a call comes in for ehdr:e_ident[ndx], and the
* specified element is one that we have a special command
* for, then we revector to that special command instead
* of using the generic ehdr:e_ident processing. This array,
* which is indexed by the e_ident[] index value is used
* to decide if that is the case. If the resulting value
* is EHDR_CMD_T_E_IDENT, then the generic processing is
* used. Otherwise, we revector to the specified command.
*/
EHDR_CMD_T_EI_MAG0, /* 0: EI_MAG0 */
EHDR_CMD_T_EI_MAG1, /* 1: EI_MAG1 */
EHDR_CMD_T_EI_MAG2, /* 2: EI_MAG2 */
EHDR_CMD_T_EI_MAG3, /* 3: EI_MAG3 */
EHDR_CMD_T_EI_CLASS, /* 4: EI_CLASS */
EHDR_CMD_T_EI_DATA, /* 5: EI_DATA */
EHDR_CMD_T_EI_VERSION, /* 6: EI_VERSION */
EHDR_CMD_T_EI_OSABI, /* 7: EI_OSABI */
EHDR_CMD_T_EI_ABIVERSION, /* 8: EI_ABIVERSION */
EHDR_CMD_T_E_IDENT, /* 9: generic */
EHDR_CMD_T_E_IDENT, /* 10: generic */
EHDR_CMD_T_E_IDENT, /* 11: generic */
EHDR_CMD_T_E_IDENT, /* 12: generic */
EHDR_CMD_T_E_IDENT, /* 13: generic */
EHDR_CMD_T_E_IDENT, /* 14: generic */
EHDR_CMD_T_E_IDENT, /* 15: generic */
};
/* Process the optional arguments */
/* Check number of arguments */
switch (cmd) {
case EHDR_CMD_T_DUMP:
/* ehdr:dump does not accept arguments */
break;
case EHDR_CMD_T_E_IDENT:
/*
* ehdr:e_ident accepts 1 or 2 arguments, the first
* being the index into the array, and the second being
* the value. If there are arguments, then process the
* index, and remove it from the argument list.
*/
e_ident_ndx = (int)
/*
* If the index is for one of the e_ident elements
* that we have a special command for, then switch
* to that command. e_ident_revector[] returns
* EHDR_CMD_T_E_IDENT in the cases where such a command
* does not exist, in which case we'll continue with the
* generic code.
*/
}
break;
case EHDR_CMD_T_E_FLAGS:
/* ehdr:e_flags accepts an arbitrary number of arguments */
break;
default:
/* The remaining commands accept a single optional argument */
break;
}
/* If there are no arguments, dump the ELF header and return */
return (ELFEDIT_CMDRET_NONE);
}
switch (cmd) {
/*
* EHDR_CMD_T_DUMP can't get here: It never has an
* argument, and is handled above.
*/
case EHDR_CMD_T_E_IDENT:
{
/*
* Only those e_ident[] elements for which we
* don't have a specialized command come here.
* The argument is a value to be set in
* e_ident[e_ident_ndx].
*/
} else {
value);
}
}
break;
case EHDR_CMD_T_E_TYPE:
{
/* The argument gives the object type */
} else {
}
}
break;
case EHDR_CMD_T_E_MACHINE:
{
/* The argument gives the machine code */
&inv_buf1));
} else {
&inv_buf1),
}
}
break;
case EHDR_CMD_T_E_VERSION:
{
/* The argument gives the version */
&inv_buf1));
} else {
&inv_buf1),
}
}
break;
case EHDR_CMD_T_E_ENTRY:
{
/* The argument gives the entry address */
} else {
}
}
break;
case EHDR_CMD_T_E_PHOFF:
{
/* The argument gives the program header offset */
NULL);
} else {
}
}
break;
case EHDR_CMD_T_E_SHOFF:
{
/* The argument gives the section header offset */
NULL);
} else {
}
}
break;
case EHDR_CMD_T_E_FLAGS:
{
int i;
/* Collect the arguments */
/* Complement the value? */
/* Perform any requested bit operations */
/* Set the value */
} else {
flags, 0, &flags_buf2));
}
}
break;
case EHDR_CMD_T_E_EHSIZE:
{
/* The argument gives the ELF header size */
NULL);
} else {
}
}
break;
case EHDR_CMD_T_E_PHENTSIZE:
{
/*
* The argument gives the size of a program
* header element.
*/
NULL);
} else {
}
}
break;
case EHDR_CMD_T_E_PHNUM:
{
/* The argument gives the number of program headers */
NULL);
} else {
sh_info = 0;
}
} else {
}
} else {
}
}
break;
case EHDR_CMD_T_E_SHENTSIZE:
{
/*
* The argument gives the size of a program
* header element.
*/
NULL);
} else {
}
}
break;
case EHDR_CMD_T_E_SHNUM:
{
/* The argument gives the number of section headers */
NULL);
if (shnum >= SHN_LORESERVE) {
e_shnum = 0;
} else {
sh_size = 0;
}
} else {
}
} else {
}
}
break;
case EHDR_CMD_T_E_SHSTRNDX:
{
/*
* By default, sec argument is name of section.
* If -shndx is used, it is a numeric index, and
* if -shtyp is used, it is a section type.
*/
else
/* Warn if the section isn't a string table */
((shstrndx >= SHN_LORESERVE) &&
(shstrndx <= SHN_HIRESERVE)) ||
if (shstrndx >= SHN_LORESERVE) {
} else {
sh_link = 0;
}
} else {
}
} else {
}
}
break;
case EHDR_CMD_T_EI_MAG0:
case EHDR_CMD_T_EI_MAG1:
case EHDR_CMD_T_EI_MAG2:
case EHDR_CMD_T_EI_MAG3:
{
/*
* This depends on EHDR_CMD_T_EI_MAG[0-3]
* being contiguous
*/
/* The argument gives the magic number byte */
} else {
}
}
break;
case EHDR_CMD_T_EI_CLASS:
{
/* The argument gives the ELFCLASS value */
} else {
0, &inv_buf1),
}
}
break;
case EHDR_CMD_T_EI_DATA:
{
/* The argument gives the ELFDATA value */
} else {
0, &inv_buf1),
}
}
break;
case EHDR_CMD_T_EI_VERSION:
{
/* The argument gives the version */
} else {
0, &inv_buf1),
}
}
break;
case EHDR_CMD_T_EI_OSABI:
{
/* The argument gives the ABI code */
} else {
0, &inv_buf1),
}
}
break;
case EHDR_CMD_T_EI_ABIVERSION:
{
/* The argument gives the ABI version */
} else {
}
}
break;
}
/*
* If we modified the ELF header, tell libelf.
*/
if (ret == ELFEDIT_CMDRET_MOD)
/* Do autoprint */
return (ret);
}
/*
* Command completion functions for the various commands
*/
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1) {
return;
}
if (argc != 2)
return;
/*
* In order to offer up the right completion strings for
* the value, we need to know what index was given for
* the first argument. If we don't recognize the index,
* we want to return quietly without issuing an error,
* so we use elfedit_atoui_range2(), which returns
*/
ELFEDIT_CONST_EI, &ndx) == 0)
return;
switch (ndx) {
case EI_CLASS:
break;
case EI_DATA:
break;
case EI_VERSION:
break;
case EI_OSABI:
break;
}
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/* This routine allows multiple flags to be specified */
}
/*ARGSUSED*/
static void
{
/*
* The plainargument can be a section name, index, or
* type, based on the options used. All have completions.
*/
return;
}
return;
}
/*
* Loop over the sections and supply command completion
* for the string tables in the file.
*/
continue;
switch (op) {
case NAME:
break;
case INDEX:
break;
case TYPE:
break;
}
}
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*ARGSUSED*/
static void
{
/*
* This command doesn't accept options, so num_opt should be
* 0. This is a defensive measure, in case that should change.
*/
if (argc == 1)
}
/*
* Implementation functions for the commands
*/
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
static elfedit_cmdret_t
{
}
/*ARGSUSED*/
{
/* Many of the commands only accept -o */
ELFEDIT_CMDOA_F_INHERIT, 0, 0 },
{ NULL }
};
/* ehdr:dump */
static const char *name_dump[] = {
};
/* ehdr:e_ident */
static const char *name_e_ident[] = {
/* MSG_INTL(MSG_ARGDESC_E_IDENT_NDX) */
ELFEDIT_CMDOA_F_OPT, 0 },
/* MSG_INTL(MSG_ARGDESC_E_IDENT_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_type */
static const char *name_e_type[] = {
/* MSG_INTL(MSG_ARGDESC_E_TYPE_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_machine */
static const char *name_e_machine[] = {
{ MSG_ORIG(MSG_STR_TYPE),
/* MSG_INTL(MSG_ARGDESC_E_MACHINE_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_version */
static const char *name_e_version[] = {
/* MSG_INTL(MSG_ARGDESC_E_VERSION_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_entry */
static const char *name_e_entry[] = {
/* MSG_INTL(MSG_ARGDESC_E_ENTRY_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_phoff */
static const char *name_e_phoff[] = {
/* MSG_INTL(MSG_ARGDESC_E_PHOFF_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_shoff */
static const char *name_e_shoff[] = {
/* MSG_INTL(MSG_ARGDESC_E_SHOFF_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_flags */
static const char *name_e_flags[] = {
ELFEDIT_CMDOA_F_INHERIT, 0, 0 },
{ NULL }
};
/* MSG_INTL(MSG_ARGDESC_E_FLAGS_VALUE) */
{ NULL }
};
/* ehdr:e_ehsize */
static const char *name_e_ehsize[] = {
/* MSG_INTL(MSG_ARGDESC_E_EHSIZE_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_phentsize */
static const char *name_e_phentsize[] = {
/* MSG_INTL(MSG_ARGDESC_E_PHENTSIZE_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_phnum */
static const char *name_e_phnum[] = {
/* MSG_INTL(MSG_ARGDESC_E_PHNUM_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_shentsize */
static const char *name_e_shentsize[] = {
/* MSG_INTL(MSG_ARGDESC_E_SHENTSIZE_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_shnum */
static const char *name_e_shnum[] = {
/* MSG_INTL(MSG_ARGDESC_E_SHNUM_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:e_shstrndx */
static const char *name_e_shstrndx[] = {
ELFEDIT_CMDOA_F_INHERIT, 0, 0 },
/* MSG_INTL(MSG_OPTDESC_SHNDX) */
/* MSG_INTL(MSG_OPTDESC_SHTYP) */
{ NULL }
};
{ MSG_ORIG(MSG_STR_SEC),
/* MSG_INTL(MSG_ARGDESC_E_SHSTRNDX_SEC) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_mag0 */
static const char *name_ei_mag0[] = {
/* MSG_INTL(MSG_ARGDESC_EI_MAG0_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_mag1 */
static const char *name_ei_mag1[] = {
/* MSG_INTL(MSG_ARGDESC_EI_MAG1_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_mag2 */
static const char *name_ei_mag2[] = {
/* MSG_INTL(MSG_ARGDESC_EI_MAG2_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_mag3 */
static const char *name_ei_mag3[] = {
/* MSG_INTL(MSG_ARGDESC_EI_MAG3_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_class */
static const char *name_ei_class[] = {
/* MSG_INTL(MSG_ARGDESC_EI_CLASS_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_data */
static const char *name_ei_data[] = {
/* MSG_INTL(MSG_ARGDESC_EI_DATA_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_version */
static const char *name_ei_version[] = {
/* Note: arg_e_version is also used for this command */
/* ehdr:ei_osabi */
static const char *name_ei_osabi[] = {
/* MSG_INTL(MSG_ARGDESC_EI_OSABI_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:ei_abiversion */
static const char *name_ei_abiversion[] = {
/* MSG_INTL(MSG_ARGDESC_EI_ABIVERSION_VALUE) */
ELFEDIT_CMDOA_F_OPT, 0 },
{ NULL }
};
/* ehdr:dump */
/* MSG_INTL(MSG_DESC_DUMP) */
/* MSG_INTL(MSG_HELP_DUMP) */
/* ehdr:e_ident */
/* MSG_INTL(MSG_DESC_E_IDENT) */
/* MSG_INTL(MSG_HELP_E_IDENT) */
opt_std, arg_e_ident },
/* ehdr:e_type */
/* MSG_INTL(MSG_DESC_E_TYPE) */
/* MSG_INTL(MSG_HELP_E_TYPE) */
opt_std, arg_e_type },
/* ehdr:e_machine */
/* MSG_INTL(MSG_DESC_E_MACHINE) */
/* MSG_INTL(MSG_HELP_E_MACHINE) */
opt_std, arg_e_machine },
/* ehdr:e_version */
/* MSG_INTL(MSG_DESC_E_VERSION) */
/* MSG_INTL(MSG_HELP_E_VERSION) */
opt_std, arg_e_version },
/* ehdr:e_entry */
/* MSG_INTL(MSG_DESC_E_ENTRY) */
/* MSG_INTL(MSG_HELP_E_ENTRY) */
opt_std, arg_e_entry },
/* ehdr:e_phoff */
/* MSG_INTL(MSG_DESC_E_PHOFF) */
/* MSG_INTL(MSG_HELP_E_PHOFF) */
opt_std, arg_e_phoff },
/* ehdr:e_shoff */
/* MSG_INTL(MSG_DESC_E_SHOFF) */
/* MSG_INTL(MSG_HELP_E_SHOFF) */
opt_std, arg_e_shoff },
/* ehdr:e_flags */
/* MSG_INTL(MSG_DESC_E_FLAGS) */
/* MSG_INTL(MSG_HELP_E_FLAGS) */
/* ehdr:e_ehsize */
/* MSG_INTL(MSG_DESC_E_EHSIZE) */
/* MSG_INTL(MSG_HELP_E_EHSIZE) */
opt_std, arg_e_ehsize },
/* ehdr:e_phentsize */
/* MSG_INTL(MSG_DESC_E_PHENTSIZE) */
/* MSG_INTL(MSG_HELP_E_PHENTSIZE) */
/* ehdr:e_phnum */
/* MSG_INTL(MSG_DESC_E_PHNUM) */
/* MSG_INTL(MSG_HELP_E_PHNUM) */
opt_std, arg_e_phnum },
/* ehdr:e_shentsize */
/* MSG_INTL(MSG_DESC_E_SHENTSIZE) */
/* MSG_INTL(MSG_HELP_E_SHENTSIZE) */
/* ehdr:e_shnum */
/* MSG_INTL(MSG_DESC_E_SHNUM) */
/* MSG_INTL(MSG_HELP_E_SHNUM) */
opt_std, arg_e_shnum },
/* ehdr:e_shstrndx */
/* MSG_INTL(MSG_DESC_E_SHSTRNDX) */
/* MSG_INTL(MSG_HELP_E_SHSTRNDX) */
/* ehdr:ei_mag0 */
/* MSG_INTL(MSG_DESC_EI_MAG0) */
/* MSG_INTL(MSG_HELP_EI_MAG0) */
opt_std, arg_ei_mag0 },
/* ehdr:ei_mag1 */
/* MSG_INTL(MSG_DESC_EI_MAG1) */
/* MSG_INTL(MSG_HELP_EI_MAG1) */
opt_std, arg_ei_mag1 },
/* ehdr:ei_mag2 */
/* MSG_INTL(MSG_DESC_EI_MAG2) */
/* MSG_INTL(MSG_HELP_EI_MAG2) */
opt_std, arg_ei_mag2 },
/* ehdr:ei_mag3 */
/* MSG_INTL(MSG_DESC_EI_MAG3) */
/* MSG_INTL(MSG_HELP_EI_MAG3) */
opt_std, arg_ei_mag3 },
/* ehdr:ei_class */
/* MSG_INTL(MSG_DESC_EI_CLASS) */
/* MSG_INTL(MSG_HELP_EI_CLASS) */
opt_std, arg_ei_class },
/* ehdr:ei_data */
/* MSG_INTL(MSG_DESC_EI_DATA) */
/* MSG_INTL(MSG_HELP_EI_DATA) */
opt_std, arg_ei_data },
/* ehdr:ei_version */
/* MSG_INTL(MSG_DESC_EI_VERSION) */
/* MSG_INTL(MSG_HELP_EI_VERSION) */
opt_std, arg_e_version },
/* ehdr:ei_osabi */
/* MSG_INTL(MSG_DESC_EI_OSABI) */
/* MSG_INTL(MSG_HELP_EI_OSABI) */
opt_std, arg_ei_osabi },
/* ehdr:ei_abiversion */
/* MSG_INTL(MSG_DESC_EI_ABIVERSION) */
/* MSG_INTL(MSG_HELP_EI_ABIVERSION) */
{ NULL }
};
/* MSG_INTL(MSG_MOD_DESC) */
return (&module);
}