str.c revision 4f680cc668fa6cf678c531083400ade9a9c7934c
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * CDDL HEADER START
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * The contents of this file are subject to the terms of the
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Common Development and Distribution License (the "License").
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * You may not use this file except in compliance with the License.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * See the License for the specific language governing permissions
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * and limitations under the License.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * When distributing Covered Code, include this CDDL HEADER in each
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If applicable, add the following below this CDDL HEADER, with the
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * fields enclosed by brackets "[]" replaced with your own identifying
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * information: Portions Copyright [yyyy] [name of copyright owner]
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * CDDL HEADER END
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Use is subject to license terms.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * This module uses shared code for several of the commands.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * It is sometimes necessary to know which specific command
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * is active.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abtypedef enum {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * We supply this function for the msg module. Only one copy is needed.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abconst char *
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * This function is supplied to elfedit through our elfedit_module_t
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * definition. It translates the opaque elfedit_i18nhdl_t handles
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * in our module interface into the actual strings for elfedit to
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * This module uses Msg codes for its i18n handle type.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * So the translation is simply to use MSG_INTL() to turn
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * it into a string and return it.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic const char *
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * The sym_opt_t enum specifies a bit value for every optional
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * argument allowed by a command in this module.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abtypedef enum {
cce0e03bb2d07f0fe27cabb93acae9c23655859fab STR_OPT_F_NOTERM = 4, /* -noterm: str:set won't term string */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab STR_OPT_F_SHNAME = 8, /* -shnam name: section spec. by name */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab STR_OPT_F_SHNDX = 16, /* -shndx ndx: strtab spec. by index */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab STR_OPT_F_SHTYP = 32, /* -shtyp type: section spec. by type */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab STR_OPT_F_STRNDX = 64, /* -strndx: String specified by index */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * A variable of type ARGSTATE is used by each command to maintain
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * information about the string table section being used, and for any
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * auxiliary sections that are related to it.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abtypedef struct {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab struct { /* String table */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab struct { /* Dynamic section */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * Given an ELF SHT_ section type constant, shndx_to_strtab() returns
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * one of the following
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abtypedef enum {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab SHTOSTR_NONE = 0, /* Type can't lead to a string table */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab SHTOSTR_LINK_STRTAB = 2, /* sh_link for type yields strtab */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab SHTOSTR_LINK_SYMTAB = 3, /* sh_link for type yields symtab */
55ef6355bc6375ad080b10b10660e3528e2b7e6aab SHTOSTR_SHF_STRINGS = 4, /* Not strtab, but SHF_STRINGS set */
55ef6355bc6375ad080b10b10660e3528e2b7e6aab * A string table section always leads to itself. A
55ef6355bc6375ad080b10b10660e3528e2b7e6aab * non-string table that has it's SHF_STRINGS section flag
55ef6355bc6375ad080b10b10660e3528e2b7e6aab * set trumps anything else.
55ef6355bc6375ad080b10b10660e3528e2b7e6aab * Look at non-stringtable section types that can lead to
55ef6355bc6375ad080b10b10660e3528e2b7e6aab * string tables via sh_link.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* These sections reference a string table via sh_link */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * These sections reference a symbol table via sh_link.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Symbol tables, in turn, reference a string table
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * via their sh_link.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Types that lead to string tables were caught above */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Given a section index, attempt to convert it into an index
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * to a string table section.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Locate and validate the string table. In the case where
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * a non-string table section is given that references a string
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * table, we will use the referenced table.
55ef6355bc6375ad080b10b10660e3528e2b7e6aab switch (shtype_to_strtab(shdr->sh_type, shdr->sh_flags)) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Sections that reference a string table via sh_link */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Sections that reference a symbol tabel via sh_link,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * which in turn reference a string table via their sh_link.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Standard argument processing for string table module
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * obj_state, argc, argv - Standard command arguments
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * optmask - Mask of allowed optional arguments.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * argstate - Address of ARGSTATE block to be initialized
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * On success, *argstate is initialized. On error,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * an error is issued and this routine does not return.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic void
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abprocess_args(elfedit_obj_state_t *obj_state, int argc, const char *argv[],
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * By default, we use the section name string table pointed at
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * by the ELF header.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Add each new option to the options mask */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab while ((getopt_ret = elfedit_getopt(&getopt_state)) != NULL) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Usage error if there are the wrong number of plain arguments.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab switch (cmd) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * The second argument (count) and the -end option are
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * mutally exclusive.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* If there may be an arbitrary amount of output, use a pager */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Return the updated values of argc/argv */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab /* Take the arbitrary section */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * Locate and validate the string table. In the case where
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * a non-string table section is given that references a string
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * table, we will use the referenced table.
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * If ndx is a string table, the following will issue the
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * proper debug messages. If it is out of range, or of any
cce0e03bb2d07f0fe27cabb93acae9c23655859fab * other type, an error is issued and it doesn't return.
55ef6355bc6375ad080b10b10660e3528e2b7e6aab argstate->str.sec = elfedit_sec_getstr(obj_state, ndx, 1);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If there is a dynamic section, check its sh_link to the
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * string table index. If these match, then we have the
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * dynamic string table. In that case, fetch the dynamic
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * section and locate the DT_SUNW_STRPAD entry, causing
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * debug messages to be issued.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Does the pad value make sense?
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Issue debug message and ignore it if not.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Locate the string table offset if argument is present */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If the -strndx option was specified, arg is an index
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * into the string table. Otherwise it is a string
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * to be looked up.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Print string table values, taking output style into account.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * autoprint - If True, output is only produced if the elfedit
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * autoprint flag is set. If False, output is always produced.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * argstate - State block for current symbol table.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic void
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab if (autoprint && ((elfedit_flags() & ELFEDIT_F_AUTOPRINT) == 0))
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If first byte is NULL and this is the default output style,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * then we want to display the range of NULL bytes, and we
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * push limit out to the last one in the sequence. Otherwise,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * just display the string.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab if ((*str == '\0') && (outstyle == ELFEDIT_OUTSTYLE_DEFAULT)) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Display the entire string table */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab elfedit_write(MSG_ORIG(MSG_STR_DQUOTE), MSG_STR_DQUOTE_SIZE);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Command body for str:set, handling the case where the 3rd
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * argument (new-str) is present.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* NULL string with no termination? Nothing to do */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Does it fit? */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Does it clobber the final NULL termination? */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab elfedit_msg(ELFEDIT_MSG_ERR, MSG_INTL(MSG_ERR_FINALNULL),
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * strtab[0] is always supposed to contain a NULL byte. You're not
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * supposed to mess with it. We will carry out this operation,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * but with a debug message indicating that it is unorthodox.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab elfedit_msg(ELFEDIT_MSG_DEBUG, MSG_INTL(MSG_DEBUG_CHGSTR0),
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Does it alter the existing value? */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab for (i = 0; i < ncp; i++)
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If the new string is longer than the old one, then it will
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * clobber the start of the following string. The resulting
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * string table is perfectly legal, but issue a debug message
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * letting the user know.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab elfedit_msg(ELFEDIT_MSG_DEBUG, MSG_INTL(MSG_DEBUG_LONGSTR),
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If we have strayed into the reserved part of the dynstr, then
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * update DT_SUNW_STRPAD.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab elfedit_msg(ELFEDIT_MSG_DEBUG, MSG_INTL(MSG_DEBUG_S_CHG),
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab strsec->sec_shndx, strsec->sec_name, ndx, len, oldstr, newstr);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Command body for str:zero
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* How many bytes to zero? */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Does it alter the existing value? */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab for (i = 0; i < count; i++)
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab elfedit_msg(ELFEDIT_MSG_DEBUG, MSG_INTL(MSG_DEBUG_Z_CHG),
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Common body for the str: module commands.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * cmd - One of the STR_CMD_T_* constants listed above, specifying
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * which command to implement.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * obj_state, argc, argv - Standard command arguments
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab process_args(obj_state, argc, argv, cmd, &argstate, &print_only);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If this call call does not change data, display the current
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * value(s) and return.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab switch (cmd) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* NOTE: STR_CMD_T_DUMP can't get here --- it's always print_only */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * If we modified the strtab section, tell libelf.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Do autoprint */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Command completion functions for the various commands
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic void
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab const char *s;
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab s = elfedit_atoconst_value_to_str(ELFEDIT_CONST_SHT, sh_type, 0);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * To get the informal tag names that are lowercase
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * and lack the leading SHT_, we copy the string we
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * have into a buffer and process it.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Handle filling in the values for -shnam, -shndx, and -shtyp options.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab/*ARGSUSED*/
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic void
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcpl_sh_opt(elfedit_obj_state_t *obj_state, void *cpldata, int argc,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab if (strcmp(argv[argc - 2], MSG_ORIG(MSG_STR_MINUS_SHNAM)) == 0) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab } else if (strcmp(argv[argc - 2], MSG_ORIG(MSG_STR_MINUS_SHNDX)) == 0) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab } else if (strcmp(argv[argc - 2], MSG_ORIG(MSG_STR_MINUS_SHTYP)) == 0) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Loop over the section headers and supply command completion
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * for the items in the file that can yield a string table.
55ef6355bc6375ad080b10b10660e3528e2b7e6aab shtostr_type = shtype_to_strtab(shdr->sh_type, shdr->sh_flags);
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab switch (op) {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Most of the commands accept an -shXXX option for the string table
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * and a string first argument. This routine examines which argument
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * is being processed, and supplies completion for these items.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abstatic void
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcpl_sec_str(elfedit_obj_state_t *obj_state, void *cpldata, int argc,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Handle -shXXX options */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* Without object state, there's no data to work from */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* If not first plain arg, return */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Look at the options, looking for two things:
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * 1) A -shXXX option specifying a section. If so, turn that
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * into a section index if possible.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * 2) Was -strndx used? If so, we are looking at an integer
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * value and have nothing to complete.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab if (strcmp(argv[ndx], MSG_ORIG(MSG_STR_MINUS_STRNDX)) == 0)
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Locate and validate the string table. In the case where
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * a non-string table section is given that references a string
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * table, we will use the referenced table.
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab (obj_state->os_secarr[strtab_ndx].sec_shdr->sh_type != SHT_STRTAB))
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab * Implementation functions for the commands
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcmd_dump(elfedit_obj_state_t *obj_state, int argc, const char *argv[])
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab return (cmd_body(STR_CMD_T_DUMP, obj_state, argc, argv));
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcmd_set(elfedit_obj_state_t *obj_state, int argc, const char *argv[])
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcmd_add(elfedit_obj_state_t *obj_state, int argc, const char *argv[])
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66abcmd_zero(elfedit_obj_state_t *obj_state, int argc, const char *argv[])
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab return (cmd_body(STR_CMD_T_ZERO, obj_state, argc, argv));
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab/*ARGSUSED*/
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:dump */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab static const char *name_dump[] = {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab MSG_ORIG(MSG_STR_EMPTY), /* "" makes this the default command */
cce0e03bb2d07f0fe27cabb93acae9c23655859fab /* MSG_INTL(MSG_OPTDESC_ANY) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNAM) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNAM), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNDX), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHTYP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHTYP), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_STRNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A1_STRING) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:set */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab static const char *name_set[] = {
cce0e03bb2d07f0fe27cabb93acae9c23655859fab /* MSG_INTL(MSG_OPTDESC_ANY) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_NOTERM) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNAM) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNAM), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNDX), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHTYP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHTYP), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_STRNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A1_STRING) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A2_NEWSTRING) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:add */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab static const char *name_add[] = {
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNAM) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNAM), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNDX), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHTYP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHTYP), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A1_NEWSTRING) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:zero */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab static const char *name_zero[] = {
cce0e03bb2d07f0fe27cabb93acae9c23655859fab /* MSG_INTL(MSG_OPTDESC_ANY) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNAM) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNAM), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHNDX), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_SHTYP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab ELFEDIT_I18NHDL(MSG_OPTDESC_SHTYP), ELFEDIT_CMDOA_F_VALUE,
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_STRNDX) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_OPTDESC_END) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A1_STRING) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_A2_COUNT) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:dump */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_DESC_DUMP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_HELP_DUMP) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:set */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_DESC_SET) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_HELP_SET) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:add */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_DESC_ADD) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_HELP_ADD) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* str:zero */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_DESC_ZERO) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_HELP_ZERO) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab /* MSG_INTL(MSG_MOD_DESC) */
ad212f6fd387c78d9e1507c5d58c58eb9bdefa66ab return (&module);