d29b2c4438482eb00488be49a1f5d6835f455546ab * CDDL HEADER START
d29b2c4438482eb00488be49a1f5d6835f455546ab * The contents of this file are subject to the terms of the
d29b2c4438482eb00488be49a1f5d6835f455546ab * Common Development and Distribution License (the "License").
d29b2c4438482eb00488be49a1f5d6835f455546ab * You may not use this file except in compliance with the License.
d29b2c4438482eb00488be49a1f5d6835f455546ab * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d29b2c4438482eb00488be49a1f5d6835f455546ab * See the License for the specific language governing permissions
d29b2c4438482eb00488be49a1f5d6835f455546ab * and limitations under the License.
d29b2c4438482eb00488be49a1f5d6835f455546ab * When distributing Covered Code, include this CDDL HEADER in each
d29b2c4438482eb00488be49a1f5d6835f455546ab * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d29b2c4438482eb00488be49a1f5d6835f455546ab * If applicable, add the following below this CDDL HEADER, with the
d29b2c4438482eb00488be49a1f5d6835f455546ab * fields enclosed by brackets "[]" replaced with your own identifying
d29b2c4438482eb00488be49a1f5d6835f455546ab * information: Portions Copyright [yyyy] [name of copyright owner]
d29b2c4438482eb00488be49a1f5d6835f455546ab * CDDL HEADER END
08278a5e91755ccdb5850c19d21d42fb2e16b50eRod Evans * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
d29b2c4438482eb00488be49a1f5d6835f455546ab * Use is subject to license terms.
d29b2c4438482eb00488be49a1f5d6835f455546ab#include <_elfedit.h>
d29b2c4438482eb00488be49a1f5d6835f455546ab * This file contains support for mapping well known ELF constants
d29b2c4438482eb00488be49a1f5d6835f455546ab * to their numeric values. It is a layer on top of the elfedit_atoui()
d29b2c4438482eb00488be49a1f5d6835f455546ab * routines defined in util.c. The idea is that centralizing all the
d29b2c4438482eb00488be49a1f5d6835f455546ab * support for such constants will improve consistency between modules,
d29b2c4438482eb00488be49a1f5d6835f455546ab * allow for sharing of commonly needed items, and make the modules
d29b2c4438482eb00488be49a1f5d6835f455546ab * simpler.
d29b2c4438482eb00488be49a1f5d6835f455546ab * elfedit output style, with and without leading -o
d29b2c4438482eb00488be49a1f5d6835f455546ab { MSG_ORIG(MSG_STR_MINUS_O_DEFAULT), ELFEDIT_OUTSTYLE_DEFAULT },
d29b2c4438482eb00488be49a1f5d6835f455546ab { MSG_ORIG(MSG_STR_MINUS_O_SIMPLE), ELFEDIT_OUTSTYLE_SIMPLE },
d29b2c4438482eb00488be49a1f5d6835f455546ab * Booleans
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * ELF strings for SHT_STRTAB
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Strings for SHT_SYMTAB
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Strings for SHT_DYNSYM
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Strings for SHT_SUNW_LDYNSYM
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { MSG_ORIG(MSG_SHT_SUNW_LDYNSYM), SHT_SUNW_LDYNSYM },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { MSG_ORIG(MSG_SHT_SUNW_LDYNSYM_ALT1), SHT_SUNW_LDYNSYM },
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Types of items found in sym_table[]. All items other than STE_STATIC
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * pulls strings from libconv, differing in the interface required by
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * the libconv iteration function used.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef enum {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami STE_STATIC = 0, /* Constants are statically defined */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami STE_LC_OS = 2, /* From libconv, osabi dependency */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami STE_LC_MACH = 3, /* From libconv, mach dependency */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami STE_LC_OS_MACH = 4 /* From libconv, osabi/mach dep. */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Interface of functions called to fill strings from libconv
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef conv_iter_ret_t (* libconv_iter_func_simple_t)(
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef conv_iter_ret_t (* libconv_iter_func_os_t)(conv_iter_osabi_t,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef conv_iter_ret_t (* libconv_iter_func_mach_t)(Half,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef conv_iter_ret_t (* libconv_iter_func_os_mach_t)(conv_iter_osabi_t, Half,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef union {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * State for each type of constant
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef struct {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami elfedit_atoui_sym_t *ste_arr; /* NULL, or atoui array */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami void *ste_alloc; /* Current memory allocation */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami libconv_iter_func_t ste_conv_func; /* libconv fill function */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Array of state for each constant type, including the array of atoui
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * pointers, for each constant type, indexed by elfedit_const_t value.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * The number and order of entries in this table must agree with the
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * definition of elfedit_const_t in elfedit.h.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * - STE_STATIC items must supply a statically allocated buffer here.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * - The non-STE_STATIC items use libconv strings. These items are
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * initialized by init_libconv_strings() at runtime, and are represented
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * by a simple { 0 } here. The memory used for these arrays is dynamic,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * and can be released and rebuilt at runtime as necessary to keep up
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * with changes in osabi or machine type.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramistatic sym_table_ent_t sym_table[ELFEDIT_CONST_NUM] = {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* #: ELFEDIT_CONST_xxx */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { STE_STATIC, sym_minus_o_outstyle }, /* 1: OUTSTYLE_MO */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { STE_STATIC, sym_sht_strtab }, /* 3: SHT_STRTAB */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { STE_STATIC, sym_sht_symtab }, /* 4: SHT_SYMTAB */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { STE_STATIC, sym_sht_dynsym }, /* 5: SHT_DYNSYM */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { STE_STATIC, sym_sht_ldynsym }, /* 6: SHT_LDYNSYM */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 7: SHN */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 8: SHT */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 9: SHT_ALLSYMTAB */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 10: DT */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 11: DF */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 12: DF_P1 */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 13: DF_1 */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 14: DTF_1 */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 15: EI */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 16: ET */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 17: ELFCLASS */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 18: ELFDATA */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 19: EF */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 20: EV */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 21: EM */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 22: ELFOSABI */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 23: EAV osabi version */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 24: PT */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 25: PF */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 26: SHF */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 27: STB */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 28: STT */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 29: STV */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 30: SYMINFO_BT */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 31: SYMINFO_FLG */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 32: CA */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 33: AV */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami { 0 }, /* 34: SF1_SUNW */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#if ELFEDIT_CONST_NUM != (ELFEDIT_CONST_SF1_SUNW)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramierror "ELFEDIT_CONST_NUM has grown. Update sym_table[]"
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Used to count the number of descriptors that will be needed to hold
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * strings from libconv.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramilibconv_count_cb(const char *str, Conv_elfvalue_t value, void *uvalue)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Used to fill in the descriptors with strings from libconv.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramitypedef struct {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramilibconv_fill_cb(const char *str, Conv_elfvalue_t value, void *uvalue)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami libconv_fill_state_t *fill_state = (libconv_fill_state_t *)uvalue;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami elfedit_atoui_sym_t *sym = &fill_state->desc[fill_state->cur++];
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Call the iteration function using the correct calling sequence for
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * the libconv routine.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramilibconv_fill_iter(sym_table_ent_t *sym, conv_iter_osabi_t osabi, Half mach,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) (* sym->ste_conv_func.osabi_mach)(osabi, mach,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (void) (* sym->ste_conv_func.osabi_mach)(osabi, mach,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Allocate/Fill an atoui array for the specified constant.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramilibconv_fill(sym_table_ent_t *sym, conv_iter_osabi_t osabi, Half mach)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* How many descriptors will we need? */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami fill_state.cnt = 1; /* Extra for NULL termination */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami libconv_fill_iter(sym, osabi, mach, libconv_count_cb, &fill_state.cnt);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * If there is an existing allocation, and it is not large enough,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * release it.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami if ((sym->ste_alloc != NULL) && (fill_state.cnt > sym->ste_nelts)) {
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Allocate memory if don't already have an allocation */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami sym->ste_alloc = elfedit_malloc(MSG_INTL(MSG_ALLOC_ELFCONDESC),
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Fill the array */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami libconv_fill_iter(sym, osabi, mach, libconv_fill_cb, &fill_state);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Add null termination */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami fill_state.desc[fill_state.cur].sym_name = NULL;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* atoui array for this item is now available */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Should be called on first call to elfedit_const_to_atoui(). Does the
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * runtime initialization of sym_table.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiinit_libconv_strings(conv_iter_osabi_t *osabi, Half *mach)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * It is critical that the ste_type and ste_conv_func values
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * agree. Since the libconv iteration function signatures can
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * change (gain or lose an osabi or mach argument), we want to
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * ensure that the compiler will catch such changes.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * The compiler will catch an attempt to assign a function of
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * the wrong type to ste_conv_func. Using these macros, we ensure
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * that the ste_type and function assignment happen as a unit.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#define LC(_ndx, _func) sym_table[_ndx].ste_type = STE_LC; \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#define LC_OS(_ndx, _func) sym_table[_ndx].ste_type = STE_LC_OS; \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#define LC_MACH(_ndx, _func) sym_table[_ndx].ste_type = STE_LC_MACH; \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami#define LC_OS_MACH(_ndx, _func) sym_table[_ndx].ste_type = STE_LC_OS_MACH; \
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami sym_table[_ndx].ste_conv_func.osabi_mach = _func;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * No input file: Supply the maximal set of strings for
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * all osabi and mach values understood by libconv.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *osabi = state.elf.obj_state.s32->os_ehdr->e_ident[EI_OSABI];
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *mach = state.elf.obj_state.s32->os_ehdr->e_machine;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *osabi = state.elf.obj_state.s64->os_ehdr->e_ident[EI_OSABI];
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami *mach = state.elf.obj_state.s64->os_ehdr->e_machine;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Set up non- STE_STATIC libconv fill functions */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS_MACH(ELFEDIT_CONST_SHN, conv_iter_sym_shndx);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS_MACH(ELFEDIT_CONST_SHT, conv_iter_sec_type);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS(ELFEDIT_CONST_SHT_ALLSYMTAB, conv_iter_sec_symtab);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS_MACH(ELFEDIT_CONST_DT, conv_iter_dyn_tag);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_DF_P1, conv_iter_dyn_posflag1);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_DTF_1, conv_iter_dyn_feature1);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_ELFCLASS, conv_iter_ehdr_class);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_MACH(ELFEDIT_CONST_EF, conv_iter_ehdr_flags);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_ELFOSABI, conv_iter_ehdr_osabi);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS(ELFEDIT_CONST_EAV, conv_iter_ehdr_abivers);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_OS_MACH(ELFEDIT_CONST_SHF, conv_iter_sec_flags);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC_MACH(ELFEDIT_CONST_STT, conv_iter_sym_info_type);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_SYMINFO_BT, conv_iter_syminfo_boundto);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_SYMINFO_FLG, conv_iter_syminfo_flags);
08278a5e91755ccdb5850c19d21d42fb2e16b50eRod Evans LC_MACH(ELFEDIT_CONST_HW1_SUNW, conv_iter_cap_val_hw1);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami LC(ELFEDIT_CONST_SF1_SUNW, conv_iter_cap_val_sf1);
08278a5e91755ccdb5850c19d21d42fb2e16b50eRod Evans LC_MACH(ELFEDIT_CONST_HW2_SUNW, conv_iter_cap_val_hw2);
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * If the user has changed the osabi or machine type of the object,
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * then we need to discard the strings we've loaded from libconv
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * that are dependent on these values.
99f63845ee65f89a523460ce4b6b0603a06eceb7abstatic void
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahramiinvalidate_libconv_strings(conv_iter_osabi_t *osabi, Half *mach)
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* Reset the ELF header change notification */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami cur_osabi = state.elf.obj_state.s32->os_ehdr->e_ident[EI_OSABI];
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami cur_mach = state.elf.obj_state.s32->os_ehdr->e_machine;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami cur_osabi = state.elf.obj_state.s64->os_ehdr->e_ident[EI_OSABI];
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami cur_mach = state.elf.obj_state.s64->os_ehdr->e_machine;
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* What has changed? */
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * Set the ste_arr pointer to NULL for any items that
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * depend on the things that have changed. Note that we
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * do not release the allocated memory --- it may turn
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * out to be large enough to hold the new strings, so we
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * keep the allocation and leave that decision to the fill
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * routine, which will run the next time those strings are
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami i < (sizeof (sym_table) / sizeof (sym_table[0])); i++, sym++) {
d29b2c4438482eb00488be49a1f5d6835f455546ab * Given an elfedit_const_t value, return the array of elfedit_atoui_sym_t
d29b2c4438482eb00488be49a1f5d6835f455546ab * entries that it represents.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami (const_type >= (sizeof (sym_table) / sizeof (sym_table[0]))))
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami elfedit_msg(ELFEDIT_MSG_ERR, MSG_INTL(MSG_ERR_BADCONST));
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * If the constant is not STE_STATIC, then we may need to fetch
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * the strings from libconv.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * If the ELF header has changed since the last
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * time we were called, then we need to invalidate any
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * strings previously pulled from libconv that have
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami * an osabi or machine dependency.
4f680cc668fa6cf678c531083400ade9a9c7934cAli Bahrami /* If we don't already have the strings, get them */